Zebediah Figura : user32: Replace the minimize box with a restore box when the window is minimized.
Alexandre Julliard
julliard at winehq.org
Wed Feb 20 16:36:59 CST 2019
Module: wine
Branch: master
Commit: 73b50a24e79b43536364a81d7de263151068cfc1
URL: https://source.winehq.org/git/wine.git/?a=commit;h=73b50a24e79b43536364a81d7de263151068cfc1
Author: Zebediah Figura <z.figura12 at gmail.com>
Date: Tue Feb 19 19:10:35 2019 -0600
user32: Replace the minimize box with a restore box when the window is minimized.
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/user32/nonclient.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/dlls/user32/nonclient.c b/dlls/user32/nonclient.c
index 372b1be..0aee137 100644
--- a/dlls/user32/nonclient.c
+++ b/dlls/user32/nonclient.c
@@ -749,13 +749,15 @@ static void NC_DrawMaxButton(HWND hwnd,HDC hdc,BOOL down, BOOL bGrayed)
static void NC_DrawMinButton(HWND hwnd,HDC hdc,BOOL down, BOOL bGrayed)
{
RECT rect;
- UINT flags = DFCS_CAPTIONMIN;
+ UINT flags;
DWORD style = GetWindowLongW( hwnd, GWL_STYLE );
DWORD ex_style = GetWindowLongW( hwnd, GWL_EXSTYLE );
/* never draw minimize box when window has WS_EX_TOOLWINDOW style */
if (ex_style & WS_EX_TOOLWINDOW) return;
+ flags = (style & WS_MINIMIZE) ? DFCS_CAPTIONRESTORE : DFCS_CAPTIONMIN;
+
NC_GetInsideRect( hwnd, COORDS_WINDOW, &rect, style, ex_style );
if (style & WS_SYSMENU)
rect.right -= GetSystemMetrics(SM_CXSIZE);
@@ -1245,7 +1247,8 @@ static void NC_TrackMinMaxBox( HWND hwnd, WORD wParam )
return;
if (wParam == HTMINBUTTON)
- SendMessageW( hwnd, WM_SYSCOMMAND, SC_MINIMIZE, MAKELONG(msg.pt.x,msg.pt.y) );
+ SendMessageW( hwnd, WM_SYSCOMMAND,
+ IsIconic(hwnd) ? SC_RESTORE : SC_MINIMIZE, MAKELONG(msg.pt.x,msg.pt.y) );
else
SendMessageW( hwnd, WM_SYSCOMMAND,
IsZoomed(hwnd) ? SC_RESTORE:SC_MAXIMIZE, MAKELONG(msg.pt.x,msg.pt.y) );
More information about the wine-cvs
mailing list