--- trunk/reactos/subsys/system/taskmgr/applpage.c 2005-10-01 15:11:31 UTC (rev 18191)
+++ trunk/reactos/subsys/system/taskmgr/applpage.c 2005-10-01 15:30:25 UTC (rev 18192)
@@ -48,6 +48,7 @@
void ApplicationPageShowContextMenu1(void);
void ApplicationPageShowContextMenu2(void);
int CALLBACK ApplicationPageCompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
+int PerfGetIndexByProcessId(DWORD dwProcessId);
#if 0
void SwitchToThisWindow (
@@ -936,9 +937,18 @@
*/
TabCtrl_SetCurFocus(hTabWnd, 1);
/*
- * FIXME: Select the process item in the list
+ * Select the process item in the list
*/
- for (i=0; i<ListView_GetItemCount(hProcessPage); i++) {
+ i = PerfGetIndexByProcessId(dwProcessId);
+ if (i != -1)
+ {
+ ListView_SetItemState(hProcessPageListCtrl,
+ i,
+ LVIS_SELECTED | LVIS_FOCUSED,
+ LVIS_SELECTED | LVIS_FOCUSED);
+ ListView_EnsureVisible(hProcessPageListCtrl,
+ i,
+ FALSE);
}
}
}
--- trunk/reactos/subsys/system/taskmgr/perfdata.c 2005-10-01 15:11:31 UTC (rev 18191)
+++ trunk/reactos/subsys/system/taskmgr/perfdata.c 2005-10-01 15:30:25 UTC (rev 18192)
@@ -345,6 +345,26 @@
return bSuccessful;
}
+int PerfGetIndexByProcessId(DWORD dwProcessId)
+{
+ int Index, FoundIndex = -1;
+
+ EnterCriticalSection(&PerfDataCriticalSection);
+
+ for (Index = 0; Index < ProcessCount; Index++)
+ {
+ if ((DWORD)pPerfData[Index].ProcessId == dwProcessId)
+ {
+ FoundIndex = Index;
+ break;
+ }
+ }
+
+ LeaveCriticalSection(&PerfDataCriticalSection);
+
+ return FoundIndex;
+}
+
ULONG PerfDataGetProcessId(ULONG Index)
{
ULONG ProcessId;