user32: Minimize and maximize boxes can only appear when WS_SYSMENU is set

Alex Henrie alexhenrie24 at gmail.com
Tue Jul 10 19:06:06 CDT 2012


This patch fixes a bug where if window manager decorations are
disabled, WS_MINIMIZEBOX and WS_MAXIMIZEBOX are set, and WS_SYSMENU is
not set, the minimize and maximize buttons are invisible until you click
on them. In such a case, the minimize and maximize buttons should not
appear at all.

This behavior is also documented on MSDN:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms632600(v=vs.85).aspx

---
 dlls/user32/nonclient.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/dlls/user32/nonclient.c b/dlls/user32/nonclient.c
index 08ce674..bc7fcc0 100644
--- a/dlls/user32/nonclient.c
+++ b/dlls/user32/nonclient.c
@@ -576,8 +576,7 @@ LRESULT NC_HandleNCHitTest( HWND hwnd, POINT pt )
             rect.top += GetSystemMetrics(SM_CYCAPTION) - 1;
         if (!PtInRect( &rect, pt ))
         {
-            BOOL min_or_max_box = (style & WS_MAXIMIZEBOX) ||
-                                  (style & WS_MINIMIZEBOX);
+            BOOL min_or_max_box = (style & WS_SYSMENU) && (style & (WS_MINIMIZEBOX|WS_MAXIMIZEBOX));
             if (ex_style & WS_EX_LAYOUTRTL)
             {
                 /* Check system menu */
-- 
1.7.9.5



More information about the wine-patches mailing list