Commit 73b50a24 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

user32: Replace the minimize box with a restore box when the window is minimized.

parent 50bc1820
...@@ -749,13 +749,15 @@ static void NC_DrawMaxButton(HWND hwnd,HDC hdc,BOOL down, BOOL bGrayed) ...@@ -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) static void NC_DrawMinButton(HWND hwnd,HDC hdc,BOOL down, BOOL bGrayed)
{ {
RECT rect; RECT rect;
UINT flags = DFCS_CAPTIONMIN; UINT flags;
DWORD style = GetWindowLongW( hwnd, GWL_STYLE ); DWORD style = GetWindowLongW( hwnd, GWL_STYLE );
DWORD ex_style = GetWindowLongW( hwnd, GWL_EXSTYLE ); DWORD ex_style = GetWindowLongW( hwnd, GWL_EXSTYLE );
/* never draw minimize box when window has WS_EX_TOOLWINDOW style */ /* never draw minimize box when window has WS_EX_TOOLWINDOW style */
if (ex_style & WS_EX_TOOLWINDOW) return; if (ex_style & WS_EX_TOOLWINDOW) return;
flags = (style & WS_MINIMIZE) ? DFCS_CAPTIONRESTORE : DFCS_CAPTIONMIN;
NC_GetInsideRect( hwnd, COORDS_WINDOW, &rect, style, ex_style ); NC_GetInsideRect( hwnd, COORDS_WINDOW, &rect, style, ex_style );
if (style & WS_SYSMENU) if (style & WS_SYSMENU)
rect.right -= GetSystemMetrics(SM_CXSIZE); rect.right -= GetSystemMetrics(SM_CXSIZE);
...@@ -1245,7 +1247,8 @@ static void NC_TrackMinMaxBox( HWND hwnd, WORD wParam ) ...@@ -1245,7 +1247,8 @@ static void NC_TrackMinMaxBox( HWND hwnd, WORD wParam )
return; return;
if (wParam == HTMINBUTTON) 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 else
SendMessageW( hwnd, WM_SYSCOMMAND, SendMessageW( hwnd, WM_SYSCOMMAND,
IsZoomed(hwnd) ? SC_RESTORE:SC_MAXIMIZE, MAKELONG(msg.pt.x,msg.pt.y) ); IsZoomed(hwnd) ? SC_RESTORE:SC_MAXIMIZE, MAKELONG(msg.pt.x,msg.pt.y) );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment