Author: mkupfer
Date: Fri Feb 20 12:03:21 2009
New Revision: 39695
URL:
http://svn.reactos.org/svn/reactos?rev=39695&view=rev
Log:
- Remove last app(s) from list if there is no application running anymore.
- See issue #4182 for more details.
Modified:
trunk/reactos/base/applications/taskmgr/applpage.c
Modified: trunk/reactos/base/applications/taskmgr/applpage.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/taskmgr/…
==============================================================================
--- trunk/reactos/base/applications/taskmgr/applpage.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/taskmgr/applpage.c [iso-8859-1] Fri Feb 20 12:03:21
2009
@@ -41,6 +41,7 @@
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 @@
*
* Should this be EnumDesktopWindows() instead?
*/
+ noApps = TRUE;
EnumWindows(EnumWindowsProc, 0);
+ if (noApps)
+ (void)ListView_DeleteAllItems(hApplicationPageListCtrl);
}
}
}
@@ -274,6 +278,7 @@
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);