How to create a password field and a button in vC ++

I am new to vC ++ and I need to Password fieldin my application. I created an edit text box using the code below, but don’t know how to create a password field and control buttons.

CreateWindow(L"EDIT", L"hello", WS_CHILD | WS_VISIBLE | WS_BORDER | ES_LEFT |
ES_AUTOHSCROLL | ES_WANTRETURN, 350, 500, 130, 20, hwnd, NULL, NULL, NULL);

Any help would be greatly appreciated. thank

+3
source share
2 answers

Try ES_PASSWORD:

Displays an asterisk (*) for each character entered in the edit control. This style is only valid for single-line editing tools.

Windows XP: user32.dll, - . , comctl32.dll 6, - .

, , EM_SETPASSWORDCHAR.

. Comctl32.dll 6 , Windows XP . Comctl32.dll 6, . . .

:

Edit

? Via :

     HWND hwndButton = CreateWindow( 
        L"BUTTON",   // Predefined class; Unicode assumed. 
        L"OK",       // Button text. 
        WS_TABSTOP | WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON, 
        0,         // x position. 
        0,         // y position. 
        50,        // Button width.
        50,        // Button height.
        hwnd_parentwindow,
        NULL,       // No menu.
        (HINSTANCE)GetWindowLong(hwnd_parentwindow, GWL_HINSTANCE), 
        NULL); 
+2
0

Source: https://habr.com/ru/post/1785884/


All Articles