Hello,
I'm trying to use OpenProcess to monitor the performance of a process (memory and cpu usage). I'm running an application as the administrator of the machine (Win XP PRO) and I get the ErrorCode = 5 (Access Denied) when trying to use the OpenProcess on a VALID ProcessID, obtained as follows:
ProcessWnd := FindWindow(ProcClassPt, ProcNamePt);
GetWindowThreadProcessId(ProcessWnd, ProcessPID);
ProcessPHnd := OpenProcess(PROCESS_QUERY_INFORMATION, False, ProcessPID);
The first two lines execute OK. I get the correct Wnd and Pid but it fails on the third line (OpenProcess). I know that this process that I'm trying to monitor has been created by a Service that also has administrator rights.
Any ideas on how not go get my access denied on that particular process?
Thank you