Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2007 May : How to check if another instance already runs in another user session?

www.cryer.info
Managed Newsgroup Archive

How to check if another instance already runs in another user session?

Subject:How to check if another instance already runs in another user session?
Posted by:"Bo Berglund" (bo.berglu..@telia.com)
Date:Fri, 18 May 2007 07:34:50

We have run up against a problem where the customers installs our
software on a Windows server and then allow multiple users logging in
to it with Remote Desktop.
Then each of the users can start its own copy of the software, thus
bypassing the licensing (enforced by a dongle).

I am now investigating what can be done about this and one thing I
came up with is that the program should check if it is already running
when it starts up. How can this be done across user sessions?

I checked Win2003 Server and looked at the Task Manager. While you are
logged on as an admin it is possible to see other user's processes via
Task manager but a normal user can only see his own processes, so that
is not a possible way I think.

Then I tried using a Mutex, but it looks like that too does not work
across user logins....

Is there other ways to detect another user's presence (or rather use
of my program) from within my own program? I need functions accessible
from within Delphi.

I am using Delphi7 and Delphi2006 as dev environments.

/Bo

Replies:

www.cryer.info
Managed Newsgroup Archive