1

Topic: Still on WinAPI GUI: Masked Edit Control

Throughout on subject WinAPI message box and layouts. As it appeared, still it was required masked edit control. To my astonishment that is not present in WinAPI. Is where the ready? Or  it is necessary?

2

Re: Still on WinAPI GUI: Masked Edit Control

Hello, Dead Down, you wrote: > As it appeared, still it was required masked edit control. To my astonishment that is not present in WinAPI. Is ES_NUMBER - edit, in which only the whole nonnegative number. Is special  for input of IP addresses (but only IPv4). Like, all on it. Generally the trend is now that: to allow to the user to enter any letters and digits, but at an output from edit (WM_KILLFOCUS or generally deactivation/closing top-level-parent windows) to show Balloon Tooltip why user fool, or to show such balloon tooltip in process of input. Then the user can  any nonsense, and in most  it already edit, without foolish restrictions like "at first remove one digit, and then enter new". , in difference from a message  not , but thus, in difference from appearing statics lejbochki - "you-not-rights", do not take a place on dialogue. To show it it is possible through EM_SHOWBALLOONTIP. Here an example balloon at IPv6-editov (which assignees IPv4 ): And built in in ES_NUMBER :

3

Re: Still on WinAPI GUI: Masked Edit Control

Hello, Alexander G, you wrote: Yes, thanks, and made...//in dialogue procedure case WM_INITDIALOG://here installed CUE banner bResult = Edit_SetCueBannerText (GetDlgItem (hDlg, IDC_PHONE_NUMBER), TEXT ("Input phone number..."));...//for  EDIT  LRESULT CALLBACK MaskedEditProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {WNDPROC oldwndproc; BOOL *mask = (BOOL *) GetWindowLong (hwnd, GWL_USERDATA); oldwndproc = (WNDPROC) mask [256]; BOOL bResult = FALSE; switch (uMsg) {//WM_NCDESTROY is the LAST message that a window will receive-//therefore we must finally remove the old wndproc here case WM_NCDESTROY: HeapFree (GetProcessHeap (), 0, mask); break; case WM_CHAR: if (mask [wParam and 0xff] == TRUE) break; else return 0; case WM_KILLFOCUS://if number incorrect that is shown  if (! IsPhoneNumberValid ()) {EDITBALLOONTIP tip = {sizeof (EDITBALLOONTIP), TEXT ("Warning!" ), TEXT ("That is not phone number!"), TTI_WARNING}; bResult = Edit_ShowBalloonTip (GetDlgItem (g_hDlg, IDC_PHONE_NUMBER), &tip); return 0;} return CallWindowProc (oldwndproc, hwnd, uMsg, wParam, lParam);} Tasku closed. But I feel all the same will be  on a mask in EDIT control. I.e. that at its input it was visible, for example such: +7 (___) ___ - __ - __ As it to make?

4

Re: Still on WinAPI GUI: Masked Edit Control

Hello, Dead Down, you wrote: > Yes, thanks, and made...  without pluses? Maniacs... It seems, it is possible and was not  was, EN_KILLFOCUS is. (Still, is better GetWindowLongPtr to use, on x86 it  on GetWindowLong with  on LONG, and on x64 - separate function, that is with GetWindowLongPtr there will be no problems at  on 64) > Tasku closed. But I feel all the same will be  on a mask in EDIT control. I.e. that at its input it was visible, for example such: +7 (___) ___ - __ - __ > As it to make? It is not assured, but I would try on a basis  nevertheless, instead of completely  . A variant: to install the text. EN_CHANGE or EN_UPDATE to catch and change the text. Plus, an insertion from  if does not generate these , it separately to catch (here, probably,  it is useful for WM_PASTE). Still a variant: ES_READONLY, most to process everyones WM_CHAR and to change contents/move the carriage.

5

Re: Still on WinAPI GUI: Masked Edit Control

> As it to make? CMFCMaskedEdit Class

6

Re: Still on WinAPI GUI: Masked Edit Control

Hello, SNNy, you wrote: >> As it to make? SNN> CMFCMaskedEdit Class No MFC. No ATL. Only WinAPI.

7

Re: Still on WinAPI GUI: Masked Edit Control

SNN>> CMFCMaskedEdit Class > No MFC. No ATL. Only WinAPI. Try to look here at it https://www.viksoe.dk/code/scanf.htm or here it https://www.viksoe.dk/code/editvalidate.htm There is finite WTL it is not too far from bare WinAPI, and can will drag easier the code on pure WinAPI

8

Re: Still on WinAPI GUI: Masked Edit Control

Hello, Dead Down, you wrote: > Is where the ready? Or  it is necessary? : where you found such operation? I too want such, something lately me  on a hardcore on old good WINAPI