Basically, I'm trying to create a password dialog in C++ for window. This may seem like a lot to ask, but I'm a total noob when it comes to windows programming other than a simple window with a rendering context and simple procedure (I mostly program games).
So here's what I have so far:
resource.rc
Code:
#include <windows.h>
// just a blank small dialog box
106 DIALOG DISCARDABLE 0, 0, 100, 20
STYLE WS_POPUP | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_TOOLWINDOW
FONT 8, "MS Sans Serif"
{
}
main.cpp
Code:
#include <windows.h>
BOOL CALLBACK DlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch(msg)
{
case WM_CLOSE: EndDialog(hwnd, 0);
break;
default:
return false;
}
return true;
}
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow) {
return DialogBox(hInstance, MAKEINTRESOURCE(106), 0, DlgProc);
}
Basically it's just a blank dialog. I wanna know how to add a small text box(the size of the window, no scrollbars or anything), that focuses on creation of the dialog, and is encrytped (shows *'s instead of what you type. it's for a password), and how to get the text typed in the text box when the user presses enter. I hope it's not too much to ask, I've been looking around and anything helpful I can find has to do with windows, not dialogs and they're created differently (not through resource, at least ones with text boxes). Thanks in advance