Break the parts down and test each.
Test your LV code with test data (comment out the process enum).
What does GetLastError() return?
Have you already added the columns successfully?
Does ListView_SetItemText() work any better?
What happens if OpenProcess() returns NULL && i==0?
What happens if OpenProcess() returns NULL && i!=0?
[two test cases, prev success and no prev success]
What happens if the process name is more than the 10 chars you are allowing in the LV? (I would use lstrlen(text) for max text )
I use an array / linked list of data structures (inc display strings, display colour codes etc).
I save the index/node pointer as the LPARAM of each LV item.
>>itoa(dwProcesses[i],PIDbuf,10);
I prefer something like
_snprintf(PIDbuf,9,"%03d",dwProcesses[i]);



LinkBack URL
About LinkBacks



