https://git.reactos.org/?p=reactos.git;a=commitdiff;h=848d7ec63356d00ff965e…
commit 848d7ec63356d00ff965ed71bb4385ba68771d39
Author: JoachimHenze <33393466+JoachimHenze(a)users.noreply.github.com>
AuthorDate: Thu Mar 5 15:39:23 2020 +0100
Commit: GitHub <noreply(a)github.com>
CommitDate: Thu Mar 5 15:39:23 2020 +0100
[NTUSER] Fix ShellHook notifications when creating/activating windows (#2396)
---
win32ss/user/ntuser/focus.c | 4 ++--
win32ss/user/ntuser/winpos.c | 2 ++
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/win32ss/user/ntuser/focus.c b/win32ss/user/ntuser/focus.c
index cc9ac5f8f5e..3c5ee19ed87 100644
--- a/win32ss/user/ntuser/focus.c
+++ b/win32ss/user/ntuser/focus.c
@@ -52,7 +52,6 @@ VOID FASTCALL
UpdateShellHook(PWND Window)
{
if ( Window->spwndParent == UserGetDesktopWindow() &&
- Window->spwndOwner == NULL &&
(!(Window->ExStyle & WS_EX_TOOLWINDOW) ||
(Window->ExStyle & WS_EX_APPWINDOW)))
{
@@ -511,7 +510,8 @@ co_IntSendActivateMessages(PWND WindowPrev, PWND Window, BOOL
MouseActivate, BOO
MAKEWPARAM(MouseActivate ? WA_CLICKACTIVE : WA_ACTIVE,
(Window->style & WS_MINIMIZE) != 0),
(LPARAM)(WindowPrev ? UserHMGetHandle(WindowPrev) : 0));
- UpdateShellHook(Window);
+ if (Window->style & WS_VISIBLE)
+ UpdateShellHook(Window);
Window->state &= ~WNDS_NONCPAINT;
diff --git a/win32ss/user/ntuser/winpos.c b/win32ss/user/ntuser/winpos.c
index 6467c2cad86..b5927d183c2 100644
--- a/win32ss/user/ntuser/winpos.c
+++ b/win32ss/user/ntuser/winpos.c
@@ -1913,6 +1913,8 @@ co_WinPosSetWindowPos(
(Window->ExStyle & WS_EX_APPWINDOW)))
{
co_IntShellHookNotify(HSHELL_WINDOWCREATED, (WPARAM)Window->head.h, 0);
+ if (!(WinPos.flags & SWP_NOACTIVATE))
+ UpdateShellHook(Window);
}
}