diff --git a/dlls/user/message.c b/dlls/user/message.c index 8fe2ee7a92..18c5d4b60f 100644 --- a/dlls/user/message.c +++ b/dlls/user/message.c @@ -1563,6 +1563,7 @@ static void send_parent_notify( HWND hwnd, WORD event, WORD idChild, POINT pt ) if (!(GetWindowLongW( hwnd, GWL_STYLE ) & WS_CHILD)) break; if (GetWindowLongW( hwnd, GWL_EXSTYLE ) & WS_EX_NOPARENTNOTIFY) break; if (!(parent = GetParent(hwnd))) break; + if (parent == GetDesktopWindow()) break; MapWindowPoints( hwnd, parent, &pt, 1 ); hwnd = parent; SendMessageW( hwnd, WM_PARENTNOTIFY, diff --git a/dlls/user/win.c b/dlls/user/win.c index 44c2461950..10a1a4fec2 100644 --- a/dlls/user/win.c +++ b/dlls/user/win.c @@ -275,8 +275,12 @@ static void send_parent_notify( HWND hwnd, UINT msg ) { if ((GetWindowLongW( hwnd, GWL_STYLE ) & (WS_CHILD | WS_POPUP)) == WS_CHILD && !(GetWindowLongW( hwnd, GWL_EXSTYLE ) & WS_EX_NOPARENTNOTIFY)) - SendMessageW( GetParent(hwnd), WM_PARENTNOTIFY, - MAKEWPARAM( msg, GetWindowLongPtrW( hwnd, GWLP_ID )), (LPARAM)hwnd ); + { + HWND parent = GetParent(hwnd); + if (parent && parent != GetDesktopWindow()) + SendMessageW( parent, WM_PARENTNOTIFY, + MAKEWPARAM( msg, GetWindowLongPtrW( hwnd, GWLP_ID )), (LPARAM)hwnd ); + } }