Jump to content
Mark Billig

Visible Application List

Recommended Posts

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

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
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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×