Protect against wrong return value from WM_INITDIALOG.
This commit is contained in:
parent
be5753d35e
commit
00442ba5ae
@ -771,12 +771,22 @@ HWND DIALOG_CreateIndirect( HINSTANCE hInst, LPCSTR dlgTemplate,
|
|||||||
if (DIALOG_CreateControls( wndPtr, dlgTemplate, &template,
|
if (DIALOG_CreateControls( wndPtr, dlgTemplate, &template,
|
||||||
hInst, win32Template ))
|
hInst, win32Template ))
|
||||||
{
|
{
|
||||||
/* Send initialisation messages and set focus */
|
HWND hwndPreInitFocus;
|
||||||
|
|
||||||
|
/* Send initialisation messages and set focus */
|
||||||
|
|
||||||
dlgInfo->hwndFocus = GetNextDlgTabItem( hwnd, 0, FALSE );
|
dlgInfo->hwndFocus = GetNextDlgTabItem( hwnd, 0, FALSE );
|
||||||
|
|
||||||
|
hwndPreInitFocus = GetFocus();
|
||||||
if (SendMessageA( hwnd, WM_INITDIALOG, (WPARAM)dlgInfo->hwndFocus, param ))
|
if (SendMessageA( hwnd, WM_INITDIALOG, (WPARAM)dlgInfo->hwndFocus, param ))
|
||||||
SetFocus( dlgInfo->hwndFocus );
|
SetFocus( dlgInfo->hwndFocus );
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* If the dlgproc has returned FALSE (indicating handling of keyboard focus)
|
||||||
|
but the focus has not changed, set the focus where we expect it. */
|
||||||
|
if ( GetFocus() == hwndPreInitFocus )
|
||||||
|
SetFocus( dlgInfo->hwndFocus );
|
||||||
|
}
|
||||||
|
|
||||||
if (template.style & WS_VISIBLE && !(wndPtr->dwStyle & WS_VISIBLE))
|
if (template.style & WS_VISIBLE && !(wndPtr->dwStyle & WS_VISIBLE))
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user