[WIN32SS][NTUSER] Fix popup menu window styles (#1814)
authorKatayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
Fri, 9 Aug 2019 23:33:25 +0000 (08:33 +0900)
committerGitHub <noreply@github.com>
Fri, 9 Aug 2019 23:33:25 +0000 (08:33 +0900)
Fix the class style, the window style and the extended style of the popup menu window. CORE-16244

win32ss/user/ntuser/class.c
win32ss/user/ntuser/menu.c

index 5982d6b..2bda750 100644 (file)
@@ -53,7 +53,7 @@ REGISTER_SYSCLASS DefaultServerClasses[] =
     ICLS_SWITCH
   },
   { ((PWSTR)((ULONG_PTR)(WORD)(0x8000))),
-    CS_DBLCLKS|CS_SAVEBITS,
+    CS_DBLCLKS|CS_SAVEBITS|CS_DROPSHADOW,
     NULL, // Use User32 procs
     sizeof(LONG),
     (HICON)OCR_NORMAL,
index a826ddb..eef1007 100644 (file)
@@ -2794,21 +2794,20 @@ static BOOL MENU_InitPopup( PWND pWndOwner, PMENU menu, UINT flags )
     CREATESTRUCTW Cs;
     LARGE_STRING WindowName;
     UNICODE_STRING ClassName;
-    DWORD ex_style = WS_EX_TOOLWINDOW;
+    DWORD ex_style = WS_EX_PALETTEWINDOW | WS_EX_DLGMODALFRAME;
 
     TRACE("owner=%p hmenu=%p\n", pWndOwner, menu);
 
     menu->spwndNotify = pWndOwner;
 
     if (flags & TPM_LAYOUTRTL || pWndOwner->ExStyle & WS_EX_LAYOUTRTL)
-       ex_style = WS_EX_LAYOUTRTL;
+       ex_style |= WS_EX_LAYOUTRTL;
 
-    ClassName.Buffer = WC_MENU;
-    ClassName.Length = 0;
+    RtlInitUnicodeString(&ClassName, WC_MENU);
 
     RtlZeroMemory(&WindowName, sizeof(WindowName));
     RtlZeroMemory(&Cs, sizeof(Cs));
-    Cs.style = WS_POPUP;
+    Cs.style = WS_POPUP | WS_CLIPSIBLINGS | WS_BORDER;
     Cs.dwExStyle = ex_style;
     Cs.hInstance = hModClient; // hModuleWin; // Server side winproc!
     Cs.lpszName = (LPCWSTR) &WindowName;