Restore MDI window in the case of disabled maximize button.

This commit is contained in:
Dmitry Timoshkov 2003-05-19 19:01:56 +00:00 committed by Alexandre Julliard
parent cdbe1570df
commit 040b3e1da5
1 changed files with 10 additions and 2 deletions

View File

@ -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;