M-Force
12th November 2007 16:41 UTC
How to check if an application is running by certain user?
Hi,
I am wondering if there is a way how to detect if a certain application is running and by what user in a multi-user system.
I found a lot of discussions how to detect a running application with an executable name but moreover I would like to know what user is running the application. If more than one user got the application running how to get the list of the users.
I need this information in order to uninstall.
I just don’t want to uninstall in one user account if the application is still running in another user account.
Thanks for your help.
M.
Afrow UK
12th November 2007 17:35 UTC
You could probably do this quite easily with the .NET Process class...
Stu
M-Force
12th November 2007 18:53 UTC
Hi Afro,
I am not familiar with the .NET Process class but it sounds to me that the user needs to have the .NET framework installed. Is that correct?
Can you explain it a little more bit in detail how i could apply that process class for my purpose or direct me to a link which gives more information.
Thank you.
M.
Afrow UK
12th November 2007 19:33 UTC
I was wrong, the Microsoft .NET Framework does not have this functionality built in. However, you can do this using Win32 API's:
http://www.experts-exchange.com/Prog..._20628622.html
That sample is written in Delphi.
Stu
M-Force
12th November 2007 21:14 UTC
Hi Afrow,
Unfortunately I am not a member of the expert-exchange website and therefore can not see the solution.
Could you attach the solution in this thread please?
Thanks
M.
Afrow UK
13th November 2007 20:53 UTC
You need to scroll down further to the 'solution'. I am not logged in and I can see it.
Stu
Anders
13th November 2007 21:15 UTC
http://pastebin.ca/772497