From b11277de4526ccec96976f46f2944aace42f25cb Mon Sep 17 00:00:00 2001 From: Matthias Kupfer Date: Fri, 20 Feb 2009 18:03:21 +0000 Subject: [PATCH] - Remove last app(s) from list if there is no application running anymore. - See issue #4182 for more details. svn path=/trunk/; revision=39695 --- reactos/base/applications/taskmgr/applpage.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/reactos/base/applications/taskmgr/applpage.c b/reactos/base/applications/taskmgr/applpage.c index e8455455504..6d8a2ecea53 100644 --- a/reactos/base/applications/taskmgr/applpage.c +++ b/reactos/base/applications/taskmgr/applpage.c @@ -41,6 +41,7 @@ static int nApplicationPageHeight; static HANDLE hApplicationPageEvent = NULL; /* When this event becomes signaled then we refresh the app list */ static BOOL bSortAscending = TRUE; DWORD WINAPI ApplicationPageRefreshThread(void *lpParameter); +BOOL noApps; BOOL CALLBACK EnumWindowsProc(HWND hWnd, LPARAM lParam); void AddOrUpdateHwnd(HWND hWnd, WCHAR *szTitle, HICON hIcon, BOOL bHung); void ApplicationPageUpdate(void); @@ -239,7 +240,10 @@ DWORD WINAPI ApplicationPageRefreshThread(void *lpParameter) * * Should this be EnumDesktopWindows() instead? */ + noApps = TRUE; EnumWindows(EnumWindowsProc, 0); + if (noApps) + (void)ListView_DeleteAllItems(hApplicationPageListCtrl); } } } @@ -274,6 +278,7 @@ BOOL CALLBACK EnumWindowsProc(HWND hWnd, LPARAM lParam) return TRUE; /* Skip this window */ } + noApps = FALSE; /* Get the icon for this window */ hIcon = NULL; SendMessageTimeoutW(hWnd, WM_GETICON,bLargeIcon ? ICON_BIG /*1*/ : ICON_SMALL /*0*/, 0, 0, 1000, (PDWORD_PTR)xhIcon);