Commit 040b3e1d authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

Restore MDI window in the case of disabled maximize button.

parent cdbe1570
......@@ -771,12 +771,20 @@ static LONG MDI_ChildActivate( HWND client, HWND child )
/* set appearance */
if (clientInfo->hwndChildMaximized && clientInfo->hwndChildMaximized != child)
{
INT cmd = SW_SHOWNORMAL;
if( child )
{
UINT state = GetMenuState(GetSystemMenu(child, FALSE), SC_MAXIMIZE, MF_BYCOMMAND);
if (state != 0xFFFFFFFF && (state & (MF_DISABLED | MF_GRAYED)))
SendMessageW(clientInfo->hwndChildMaximized, WM_SYSCOMMAND, SC_RESTORE, 0);
else
cmd = SW_SHOWMAXIMIZED;
clientInfo->hwndActiveChild = child;
ShowWindow( child, SW_SHOWMAXIMIZED);
}
else ShowWindow( clientInfo->hwndActiveChild, SW_SHOWNORMAL );
ShowWindow( clientInfo->hwndActiveChild, cmd );
}
clientInfo->hwndActiveChild = child;
......
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