user: test and fix SwitchToThisWindow [3rd try]
Alexandre Julliard
julliard at winehq.org
Tue Sep 26 04:14:12 CDT 2006
Jan Zerebecki <jan.wine at zerebecki.de> writes:
> diff --git a/dlls/user/winpos.c b/dlls/user/winpos.c
> index 6bc9056..e78f484 100644
> --- a/dlls/user/winpos.c
> +++ b/dlls/user/winpos.c
> @@ -152,7 +152,20 @@ UINT WINAPI ArrangeIconicWindows( HWND p
> */
> void WINAPI SwitchToThisWindow( HWND hwnd, BOOL restore )
> {
> - ShowWindow( hwnd, restore ? SW_RESTORE : SW_SHOWMINIMIZED );
> + HWND hwndOld = GetForegroundWindow();
> + SetActiveWindow( hwnd );
> + SetForegroundWindow( hwnd );
> + if ( restore )
> + {
> + if ( IsIconic( hwnd ) )
> + ShowWindow( hwnd, SW_RESTORE );
> + }
> + else
> + {
> + if ( !( GetWindowLongW( hwndOld, GWL_EXSTYLE ) & WS_EX_TOPMOST ) )
> + SetWindowPos( hwndOld, HWND_BOTTOM, 0, 0, 0, 0,
> + SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE );
> + }
That HWND_BOTTOM thing looks very wrong, SwitchToThisWindow is
supposed to move things to the front. Most likely your test case is
flawed.
--
Alexandre Julliard
julliard at winehq.org
More information about the wine-devel
mailing list