Click here to Skip to main content
15,885,767 members
Please Sign up or sign in to vote.
4.11/5 (2 votes)
See more:
Hi friends,

The use of mutex to ensure only one instance of the application is quite easy and widespread, as it is easy to use Process Explorer to delete the handle to the Mutex....

I was wondering if it is possible to have a callback event (or any other devilry) to be notified that the mutex was just deleted with PE (the polling is not allowed ....)

Any sample or hints????

Thanks in advance
Posted
Updated 29-Jul-14 4:35am
v2

1 solution

There is no such event or callback.

AFAIK, your only option is to poll for it.
 
Share this answer
 
Comments
2006 Flauzer 5-Aug-14 8:35am    
Thanks and sorry for delay...

A simply Timer proc (ie System.Timers.Timer()) it's ok and threadsafe for this "watchdog" in a dll (I use it in a website)?

Any hints or reliable way to achieve this?

Thanks.
Dave Kreskowiak 5-Aug-14 12:46pm    
WHAT??? A website? WHY? What's the point of this?

Why would a website be monitoring a mutex?
2006 Flauzer 5-Aug-14 13:56pm    
Old story, corporate decisions, questionable,...
a website is licensed, so there is only one web app with a specific dll.
Same question in a WCF web service, the same specific dll x licence.
Dave Kreskowiak 5-Aug-14 18:42pm    
OK, weird.

Since a web server/WCF service cannot push notifications to clients a better solution would be to poll for the mutex in a Windows Service app.

What you do with that information is up to you. A web site could connect to the service over a named pipe and talk to it for the data it needs.

2006 Flauzer 6-Aug-14 2:53am    
the win service and named pipe is a good suggestion. thank you

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900