From 2a4c54d85c30330d233de3201fc6a4ce286f246d Mon Sep 17 00:00:00 2001 From: James Tabor Date: Sat, 21 May 2011 00:24:38 +0000 Subject: [PATCH] [User32] - When active or inactive set the appropriate action so the correct keyboard mode can be returned. svn path=/trunk/; revision=51833 --- reactos/dll/win32/user32/windows/dialog.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/reactos/dll/win32/user32/windows/dialog.c b/reactos/dll/win32/user32/windows/dialog.c index 54548278b7f..b967dfc8e1c 100644 --- a/reactos/dll/win32/user32/windows/dialog.c +++ b/reactos/dll/win32/user32/windows/dialog.c @@ -39,7 +39,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(user32); #define DF_END 0x0001 #define DF_OWNERENABLED 0x0002 -#define DF_DIALOGACTIVE 0x4000 +#define DF_DIALOGACTIVE 0x4000 // ReactOS #define DWLP_ROS_DIALOGINFO (DWLP_USER+sizeof(ULONG_PTR)) #define GETDLGINFO(hwnd) DIALOG_get_info(hwnd, FALSE) #define SETDLGINFO(hwnd, info) SetWindowLongPtrW((hwnd), DWLP_ROS_DIALOGINFO, (LONG_PTR)(info)) @@ -1143,7 +1143,13 @@ static LRESULT DEFDLG_Proc( HWND hwnd, UINT msg, WPARAM wParam, return DefWindowProcA( hwnd, msg, wParam, lParam ); case WM_ACTIVATE: - NtUserSetThreadState(DF_DIALOGACTIVE,DF_DIALOGACTIVE); + { // ReactOS + DWORD dwSetFlag; + HWND hwndparent = DIALOG_FindMsgDestination( hwnd ); + // if WA_CLICK/ACTIVE ? set dialog is active. + dwSetFlag = wParam ? DF_DIALOGACTIVE : 0; + if (hwndparent != hwnd) NtUserSetThreadState(dwSetFlag, DF_DIALOGACTIVE); + } if (wParam) DEFDLG_RestoreFocus( hwnd ); else DEFDLG_SaveFocus( hwnd ); return 0;