mirror of
https://github.com/QB64-Phoenix-Edition/QB64pe.git
synced 2024-08-05 12:20:24 +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:
parent
7bf68383d5
commit
5b238467a9
1 changed files with 5 additions and 2 deletions
|
@ -1229,12 +1229,12 @@ static BOOL CALLBACK dialogBoxCallback(HWND hwndDlg, UINT message, WPARAM wParam
|
||||||
{
|
{
|
||||||
case IDOK:
|
case IDOK:
|
||||||
GetDlgItemText(hwndDlg, ID_TEXT, dialogContents, MAX_PATH_OR_CMD);
|
GetDlgItemText(hwndDlg, ID_TEXT, dialogContents, MAX_PATH_OR_CMD);
|
||||||
DestroyWindow(hwndDlg);
|
EndDialog(hwndDlg, 0);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
case IDCANCEL:
|
case IDCANCEL:
|
||||||
memset(dialogContents, 0, sizeof(dialogContents));
|
memset(dialogContents, 0, sizeof(dialogContents));
|
||||||
DestroyWindow(hwndDlg);
|
EndDialog(hwndDlg, 0);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1332,6 +1332,9 @@ static LRESULT DisplayMyMessage(HINSTANCE hinst, HWND hwndOwner, const wchar_t *
|
||||||
lpdit->id = ID_TEXT; // Text identifier
|
lpdit->id = ID_TEXT; // Text identifier
|
||||||
lpdit->style = WS_CHILD | WS_VISIBLE | WS_BORDER | ES_AUTOHSCROLL | ES_LEFT;
|
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 = (LPWORD)(lpdit + 1);
|
||||||
*lpw++ = 0xFFFF;
|
*lpw++ = 0xFFFF;
|
||||||
*lpw++ = 0x0081; // Edit class
|
*lpw++ = 0x0081; // Edit class
|
||||||
|
|
Loading…
Reference in a new issue