mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 09:34:43 +00:00
implemented the "Go to process" feature
svn path=/trunk/; revision=18192
This commit is contained in:
parent
38ecd48776
commit
6526069195
2 changed files with 32 additions and 2 deletions
|
@ -48,6 +48,7 @@ void ApplicationPageOnNotify(WPARAM wParam, LPARAM lParam);
|
|||
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 @@ void ApplicationPage_OnGotoProcess(void)
|
|||
*/
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -345,6 +345,26 @@ BOOL PerfDataGetImageName(ULONG Index, LPTSTR lpImageName, int nMaxCount)
|
|||
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;
|
||||
|
|
Loading…
Reference in a new issue