From fc02f8d4545790443c0dda7049e89b070ef28790 Mon Sep 17 00:00:00 2001 From: Thomas Bluemel Date: Wed, 21 Nov 2007 09:12:20 +0000 Subject: [PATCH] Make dialogs update the UI state svn path=/trunk/; revision=30613 --- reactos/dll/win32/user32/windows/defwnd.c | 2 +- reactos/dll/win32/user32/windows/dialog.c | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/reactos/dll/win32/user32/windows/defwnd.c b/reactos/dll/win32/user32/windows/defwnd.c index 1e037655e36..e795474fd37 100644 --- a/reactos/dll/win32/user32/windows/defwnd.c +++ b/reactos/dll/win32/user32/windows/defwnd.c @@ -1683,7 +1683,7 @@ User32DefWindowProc(HWND hWnd, { /* We're a child window and we need to pass this message down until we reach the root */ - hWnd = UserHMGetHandle(Wnd->Parent); + hWnd = UserHMGetHandle((PWINDOW)DesktopPtrToUser(Wnd->Parent)); } else { diff --git a/reactos/dll/win32/user32/windows/dialog.c b/reactos/dll/win32/user32/windows/dialog.c index 7c258d8176d..c68e055c4eb 100644 --- a/reactos/dll/win32/user32/windows/dialog.c +++ b/reactos/dll/win32/user32/windows/dialog.c @@ -816,6 +816,8 @@ static HWND DIALOG_CreateIndirect( HINSTANCE hInst, LPCVOID dlgTemplate, SetFocus( dlgInfo->hwndFocus ); } + SendMessageW( hwnd, WM_CHANGEUISTATE, MAKEWPARAM(UIS_INITIALIZE, 0), 0); + if (template.style & WS_VISIBLE && !(GetWindowLongW( hwnd, GWL_STYLE ) & WS_VISIBLE)) { ShowWindow( hwnd, SW_SHOWNORMAL ); /* SW_SHOW doesn't always work */ @@ -2207,6 +2209,8 @@ IsDialogMessageW( case VK_TAB: if (!(dlgCode & DLGC_WANTTAB)) { + SendMessageW(hDlg, WM_CHANGEUISTATE, MAKEWPARAM(UIS_CLEAR, UISF_HIDEFOCUS), 0); + /* I am not sure under which circumstances the TAB is handled * each way. All I do know is that it does not always simply * send WM_NEXTDLGCTL. (Personally I have never yet seen it @@ -2306,6 +2310,10 @@ IsDialogMessageW( return TRUE; } break; + + case WM_SYSKEYDOWN: + SendMessageW(hDlg, WM_CHANGEUISTATE, MAKEWPARAM(UIS_CLEAR, UISF_HIDEFOCUS), 0); + break; } TranslateMessage( lpMsg );