Mark Billig 0 Posted Tuesday at 09:51 PM I am trying to create a list of applications that are running and visible, similar to Windows "Task Manager" in simple view. I have been successful except for applications that are running elevated. I am trying to get the "File Description" property and as long as I can get the file name and path I can get the description. Is there a way to get the file description directly or a way to get the name and path of an elevated application? I have been searching but everything I have come across so far does not work. Share this post Link to post
Remy Lebeau 1392 Posted Wednesday at 02:27 AM What exactly have you tried that is not working for you? Please show some code. Which API are you using to enumerate running processes? CreateToolhelp32Snapshot(), EnumProcesses(), EnumWindows()? Have you tried APIs like GetModuleFileNameEx(), GetProcessImageFileName(), QueryFullProcessImageName()? Share this post Link to post
Mark Billig 0 Posted Wednesday at 04:25 PM I am attaching the code I have at this time. I am using CreateToolhelp32Snapshot and GetModuleFileNameEx. MFUnit.pas Share this post Link to post
Remy Lebeau 1392 Posted Wednesday at 05:43 PM 1 hour ago, Mark Billig said: hProcess := OpenProcess(PROCESS_QUERY_INFORMATION or PROCESS_VM_READ, false, PID); Try using PROCESS_QUERY_LIMITED_INFORMATION instead. And do try using GetProcessImageFileName() or QueryFullProcessImageName() instead of GetModuleFileNameEx(). This approach should be more compatible with elevated processes. Share this post Link to post
Mark Billig 0 Posted Wednesday at 06:49 PM Thank you for your assistance. I changed to PROCESS_QUERY_LIMITED_INFORMATION and it is working. I thought I had changed it before but I must not have. // hProcess := OpenProcess(PROCESS_QUERY_INFORMATION or PROCESS_VM_READ, False, PID); hProcess := OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION, False, PID); Share this post Link to post