How to find a process in another login session?

G

Guest

I have an application that starts automatically on user login to windows. it
works fine.
We have customers that use Remote Connection or Citrix on the server
and thus our application executes in each open session.
we tried to avoid a second instance of our app using global Mutex object but
no success.
we tried to find a previous instance using EnumProcesses, but it doesn't
give processes from other session.

How can i check for another application instance that may run in another
login session (NT, 2000, 2003...)

thanks

rafi
 
G

Guest

Can't you simply use Task Manager or Terminal Services Manager to see the
process list and associated user?
 
G

Guest

Hi, Rafi
You will never be able to do what you want to do without giving the user
advanced rights on the server.

The simplest solution is, usually, the most effective one.
1. Embed the application in a batch file.
2. In the batch file before launching the application itself, create a file
in the user's temp directory called "appl.flg"
3. Before you create the file you must check for it's existence. If the file
exists - the application is running, do nothing. If it does not - create the
file and launch the application.
4. On the logout and after the application exists - delete the file


Jetro CockpIT
Fulfilling the promise of server-based computing
http://www.jp-inc.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top