diff --git a/programs/taskmgr/priority.c b/programs/taskmgr/priority.c index 1a5ea372165..49f23a2b1a2 100644 --- a/programs/taskmgr/priority.c +++ b/programs/taskmgr/priority.c @@ -36,7 +36,7 @@ static void DoSetPriority(DWORD priority) { LVITEMW lvitem; - ULONG Index; + ULONG Index, Count; DWORD dwProcessId; HANDLE hProcess; WCHAR wstrErrorText[256]; @@ -49,7 +49,8 @@ static void DoSetPriority(DWORD priority) LoadStringW(hInst, IDS_WARNING_TITLE, wszWarnTitle, sizeof(wszWarnTitle)/sizeof(WCHAR)); LoadStringW(hInst, IDS_PRIORITY_UNABLE2CHANGE, wszUnable2Change, sizeof(wszUnable2Change)/sizeof(WCHAR)); - for (Index=0; Index<(ULONG)ListView_GetItemCount(hProcessPageListCtrl); Index++) + Count = SendMessageW(hProcessPageListCtrl, LVM_GETITEMCOUNT, 0, 0); + for (Index=0; Index