Author: fireball Date: Thu Oct 28 13:50:53 2010 New Revision: 49329
URL: http://svn.reactos.org/svn/reactos?rev=49329&view=rev Log: - Implement RegisterShellHookWindow/DeregisterShellHookWindow in user32. Running applications now appear in Explorer's taskbar (except for console windows and inactive windows, bug #5206). - Thanks to Maarten Kroese, this work is partially based on his patch.
Modified: branches/arwinss/reactos/dll/win32/user32/focus.c branches/arwinss/reactos/dll/win32/user32/hook.c branches/arwinss/reactos/dll/win32/user32/misc.c
Modified: branches/arwinss/reactos/dll/win32/user32/focus.c URL: http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/user32... ============================================================================== --- branches/arwinss/reactos/dll/win32/user32/focus.c [iso-8859-1] (original) +++ branches/arwinss/reactos/dll/win32/user32/focus.c [iso-8859-1] Thu Oct 28 13:50:53 2010 @@ -153,6 +153,9 @@ SendMessageW( hwnd, WM_ACTIVATE, MAKEWPARAM( mouse ? WA_CLICKACTIVE : WA_ACTIVE, IsIconic(hwnd) ), (LPARAM)previous ); + + /* Call WH_SHELL hook */ + HOOK_CallHooks( WH_SHELL, HSHELL_WINDOWACTIVATED, (WPARAM)hwnd, 0, TRUE ); }
/* now change focus if necessary */
Modified: branches/arwinss/reactos/dll/win32/user32/hook.c URL: http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/user32... ============================================================================== --- branches/arwinss/reactos/dll/win32/user32/hook.c [iso-8859-1] (original) +++ branches/arwinss/reactos/dll/win32/user32/hook.c [iso-8859-1] Thu Oct 28 13:50:53 2010 @@ -74,6 +74,7 @@ #include "winerror.h" #include "win.h" #include "user_private.h" +#include "wine/rosuser.h" #include "wine/server.h" #include "wine/unicode.h" #include "wine/debug.h" @@ -412,6 +413,21 @@
USER_CheckNotLock();
+ if (id == WH_SHELL) + { + HWND *hook_windows = RosUserBuildShellHookHwndList(); + if (hook_windows) + { + INT wm_shellhook = RegisterWindowMessageW(L"SHELLHOOK"); + HWND* cursor = hook_windows; + + for (; *cursor; cursor++) + PostMessage(*cursor, wm_shellhook, code, wparam); + + HeapFree(GetProcessHeap(), 0, hook_windows); + } + } + if (!HOOK_IsHooked( id )) { TRACE( "skipping hook %s mask %x\n", hook_names[id-WH_MINHOOK], thread_info->active_hooks ); @@ -897,3 +913,20 @@ WARN("(%d)-stub!\n", dwEvent); return TRUE; } + +/*********************************************************************** + * RegisterShellHookWindow [USER32.@] + */ +BOOL WINAPI RegisterShellHookWindow ( HWND hWnd ) +{ + return RosUserRegisterShellHookWindow( hWnd ); +} + + +/*********************************************************************** + * DeregisterShellHookWindow [USER32.@] + */ +HRESULT WINAPI DeregisterShellHookWindow ( HWND hWnd ) +{ + return RosUserDeRegisterShellHookWindow( hWnd ); +}
Modified: branches/arwinss/reactos/dll/win32/user32/misc.c URL: http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/user32... ============================================================================== --- branches/arwinss/reactos/dll/win32/user32/misc.c [iso-8859-1] (original) +++ branches/arwinss/reactos/dll/win32/user32/misc.c [iso-8859-1] Thu Oct 28 13:50:53 2010 @@ -437,26 +437,6 @@ FIXME("(%08x, %08x)\n", flags, reserved); }
-/*********************************************************************** - * RegisterShellHookWindow [USER32.@] - */ -BOOL WINAPI RegisterShellHookWindow ( HWND hWnd ) -{ - FIXME("(%p): stub\n", hWnd); - return 0; -} - - -/*********************************************************************** - * DeregisterShellHookWindow [USER32.@] - */ -HRESULT WINAPI DeregisterShellHookWindow ( HWND u ) -{ - FIXME("0x%08x stub\n",u); - return 0; - -} -
/*********************************************************************** * RegisterTasklist [USER32.@]