diff --git a/dlls/user32/winpos.c b/dlls/user32/winpos.c index c2b35ec..d49be31 100644 --- a/dlls/user32/winpos.c +++ b/dlls/user32/winpos.c @@ -1227,6 +1227,8 @@ BOOL WINAPI ShowWindowAsync( HWND hwnd, INT cmd ) BOOL WINAPI ShowWindow( HWND hwnd, INT cmd ) { HWND full_handle; + LONG style; + BOOL wasVisible; if (is_broadcast(hwnd)) { @@ -1236,8 +1238,37 @@ BOOL WINAPI ShowWindow( HWND hwnd, INT cmd ) if ((full_handle = WIN_IsCurrentThread( hwnd ))) return show_window( full_handle, cmd ); - if ((cmd == SW_HIDE) && !(GetWindowLongW( hwnd, GWL_STYLE ) & WS_VISIBLE)) - return FALSE; + style = GetWindowLongW( hwnd, GWL_STYLE ); + wasVisible = (style & WS_VISIBLE) != 0; + + switch(cmd) + { + case SW_HIDE: + if (!wasVisible) return FALSE; + break; + case SW_SHOWMINNOACTIVE: + case SW_MINIMIZE: + case SW_FORCEMINIMIZE: + case SW_SHOWMINIMIZED: + if ((style & WS_MINIMIZE) && wasVisible) return TRUE; + break; + case SW_SHOWMAXIMIZED: + if ((style & WS_MAXIMIZE) && wasVisible) return TRUE; + break; + case SW_SHOWNA: + break; + case SW_SHOW: + if (wasVisible) return TRUE; + break; + case SW_SHOWNOACTIVATE: + case SW_RESTORE: + case SW_SHOWNORMAL: + case SW_SHOWDEFAULT: + if (!(style & (WS_MINIMIZE | WS_MAXIMIZE)) && wasVisible) return TRUE; + break; + default: + return wasVisible; + } return SendMessageW( hwnd, WM_WINE_SHOWWINDOW, cmd, 0 ); }