1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-07-06 19:50:22 +00:00

Use hidden input if defaultText is blank

Fairly simple, this sets the ES_PASSWORD flag when the default text is
blank.

Additionally I fixed the dialog callback to correctly call EndDialog()
rather than DestroyWindow().
This commit is contained in:
Matthew Kilgore 2022-11-07 20:58:58 -05:00 committed by Matt Kilgore
parent 7bf68383d5
commit 5b238467a9

View file

@ -1229,12 +1229,12 @@ static BOOL CALLBACK dialogBoxCallback(HWND hwndDlg, UINT message, WPARAM wParam
{
case IDOK:
GetDlgItemText(hwndDlg, ID_TEXT, dialogContents, MAX_PATH_OR_CMD);
DestroyWindow(hwndDlg);
EndDialog(hwndDlg, 0);
return TRUE;
case IDCANCEL:
memset(dialogContents, 0, sizeof(dialogContents));
DestroyWindow(hwndDlg);
EndDialog(hwndDlg, 0);
return TRUE;
}
}
@ -1332,6 +1332,9 @@ static LRESULT DisplayMyMessage(HINSTANCE hinst, HWND hwndOwner, const wchar_t *
lpdit->id = ID_TEXT; // Text identifier
lpdit->style = WS_CHILD | WS_VISIBLE | WS_BORDER | ES_AUTOHSCROLL | ES_LEFT;
if (wcslen(defaultText) == 0)
lpdit->style |= ES_PASSWORD;
lpw = (LPWORD)(lpdit + 1);
*lpw++ = 0xFFFF;
*lpw++ = 0x0081; // Edit class