Check again for GetNextDlgTabItem after return from WM_INITDIALOG
message in dialog creation.
This commit is contained in:
parent
ac3e81640a
commit
a4b73d43cd
|
@ -792,14 +792,22 @@ HWND DIALOG_CreateIndirect( HINSTANCE hInst, LPCSTR dlgTemplate,
|
||||||
|
|
||||||
hwndPreInitFocus = GetFocus();
|
hwndPreInitFocus = GetFocus();
|
||||||
if (SendMessageA( hwnd, WM_INITDIALOG, (WPARAM)dlgInfo->hwndFocus, param ))
|
if (SendMessageA( hwnd, WM_INITDIALOG, (WPARAM)dlgInfo->hwndFocus, param ))
|
||||||
|
{
|
||||||
|
/* check where the focus is again, some controls status might have changed in
|
||||||
|
WM_INITDIALOG */
|
||||||
|
dlgInfo->hwndFocus = GetNextDlgTabItem( hwnd, 0, FALSE);
|
||||||
SetFocus( dlgInfo->hwndFocus );
|
SetFocus( dlgInfo->hwndFocus );
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* If the dlgproc has returned FALSE (indicating handling of keyboard focus)
|
/* If the dlgproc has returned FALSE (indicating handling of keyboard focus)
|
||||||
but the focus has not changed, set the focus where we expect it. */
|
but the focus has not changed, set the focus where we expect it. */
|
||||||
if ( (wndPtr->dwStyle & WS_VISIBLE) && ( GetFocus() == hwndPreInitFocus ) )
|
if ( (wndPtr->dwStyle & WS_VISIBLE) && ( GetFocus() == hwndPreInitFocus ) )
|
||||||
|
{
|
||||||
|
dlgInfo->hwndFocus = GetNextDlgTabItem( hwnd, 0, FALSE);
|
||||||
SetFocus( dlgInfo->hwndFocus );
|
SetFocus( dlgInfo->hwndFocus );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (template.style & WS_VISIBLE && !(wndPtr->dwStyle & WS_VISIBLE))
|
if (template.style & WS_VISIBLE && !(wndPtr->dwStyle & WS_VISIBLE))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue