Michael Stefaniuc : taskmgr: SwitchToThisWindow() is available, remove alternate code path.
Module: wine Branch: master Commit: ef10cd8b6da2ff4a032aebd0f345cdcb8b42d1c4 URL: https://source.winehq.org/git/wine.git/?a=commit;h=ef10cd8b6da2ff4a032aebd0f... Author: Michael Stefaniuc <mstefani(a)winehq.org> Date: Thu Oct 15 23:09:40 2020 +0200 taskmgr: SwitchToThisWindow() is available, remove alternate code path. Signed-off-by: Michael Stefaniuc <mstefani(a)winehq.org> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- programs/taskmgr/applpage.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/programs/taskmgr/applpage.c b/programs/taskmgr/applpage.c index 6b2e04077c2..b35881c2323 100644 --- a/programs/taskmgr/applpage.c +++ b/programs/taskmgr/applpage.c @@ -47,8 +47,6 @@ static int nApplicationPageHeight; static HANDLE hApplicationPageEvent = NULL; /* When this event becomes signaled then we refresh the app list */ static BOOL bSortAscending = TRUE; -static const WCHAR wszUser32[] = {'U','S','E','R','3','2','.','D','L','L',0}; - static void ApplicationPageUpdate(void) { /* Enable or disable the "End Task" & "Switch To" buttons */ @@ -743,19 +741,7 @@ void ApplicationPage_OnSwitchTo(void) } } if (pAPLI) { - typedef void (WINAPI *PROCSWITCHTOTHISWINDOW) (HWND, BOOL); - PROCSWITCHTOTHISWINDOW SwitchToThisWindow; - - HMODULE hUser32 = GetModuleHandleW(wszUser32); - SwitchToThisWindow = (PROCSWITCHTOTHISWINDOW)GetProcAddress(hUser32, "SwitchToThisWindow"); - if (SwitchToThisWindow) { - SwitchToThisWindow(pAPLI->hWnd, TRUE); - } else { - if (IsIconic(pAPLI->hWnd)) - ShowWindow(pAPLI->hWnd, SW_RESTORE); - BringWindowToTop(pAPLI->hWnd); - SetForegroundWindow(pAPLI->hWnd); - } + SwitchToThisWindow(pAPLI->hWnd, TRUE); if (TaskManagerSettings.MinimizeOnUse) ShowWindow(hMainWnd, SW_MINIMIZE); }
participants (1)
-
Alexandre Julliard