Index: win32ss/user/ntuser/defwnd.c =================================================================== --- win32ss/user/ntuser/defwnd.c (revision 73889) +++ win32ss/user/ntuser/defwnd.c (working copy) @@ -259,12 +259,14 @@ if (Msg == WM_LBUTTONDOWN) { + PWND pwndDesktop = UserGetDesktopWindow(); + // Find a pop up window to bring active. - pwndPopUP = co_IntFindChildWindowToOwner(UserGetDesktopWindow(), pWnd); + pwndPopUP = co_IntFindChildWindowToOwner(pwndDesktop, pWnd); if (pwndPopUP) { // Not a child pop up from desktop. - if ( pwndPopUP != UserGetDesktopWindow()->spwndChild ) + if (pwndPopUP != pwndDesktop->spwndChild) { // Get original active window. PWND pwndOrigActive = gpqForeground->spwndActive; @@ -908,8 +910,8 @@ if (LOWORD(lParam) < HTLEFT || LOWORD(lParam) > HTBOTTOMRIGHT) { PWND parent = Wnd->spwndParent;//IntGetParent( Wnd ); - if (parent != UserGetDesktopWindow() && - co_IntSendMessage( UserHMGetHandle(parent), WM_SETCURSOR, wParam, lParam)) + if (!UserIsDesktopWindow(parent) && + co_IntSendMessage(UserHMGetHandle(parent), WM_SETCURSOR, wParam, lParam)) return TRUE; } } Index: win32ss/user/ntuser/focus.c =================================================================== --- win32ss/user/ntuser/focus.c (revision 73889) +++ win32ss/user/ntuser/focus.c (working copy) @@ -51,7 +51,7 @@ VOID FASTCALL UpdateShellHook(PWND Window) { - if ( Window->spwndParent == UserGetDesktopWindow() && + if (UserIsDesktopWindow(Window->spwndParent) && Window->spwndOwner == NULL && (!(Window->ExStyle & WS_EX_TOOLWINDOW) || (Window->ExStyle & WS_EX_APPWINDOW))) Index: win32ss/user/ntuser/menu.c =================================================================== --- win32ss/user/ntuser/menu.c (revision 73889) +++ win32ss/user/ntuser/menu.c (working copy) @@ -4238,7 +4238,7 @@ * * Menu-bar tracking upon a mouse event. Called from NC_HandleSysCommand(). */ -VOID MENU_TrackMouseMenuBar( PWND pWnd, ULONG ht, POINT pt) +VOID MENU_TrackMouseMenuBar(PWND pWnd, ULONG ht, POINT pt) { PMENU pMenu = (ht == HTSYSMENU) ? get_win_sys_menu( UserHMGetHandle(pWnd) ) : IntGetMenu( UserHMGetHandle(pWnd) ); UINT wFlags = TPM_BUTTONDOWN | TPM_LEFTALIGN | TPM_LEFTBUTTON; @@ -4249,8 +4249,8 @@ if (VerifyMenu(pMenu)) { /* map point to parent client coordinates */ - PWND Parent = UserGetAncestor(pWnd, GA_PARENT ); - if (Parent != UserGetDesktopWindow()) + PWND Parent = UserGetAncestor(pWnd, GA_PARENT); + if (!UserIsDesktopWindow(Parent)) { IntScreenToClient(Parent, &pt); }