Question : Question about Windows messaging and this Mutex example

In this demo shown here:

http://sanity-free.org/143/csharp_dotnet_single_instance_application.html

the program uses a Mutex to prevent multiple instance from opening.  It uses Windows messaging.  Does the first instance send a message and the second instance read that message, then exits?

If so where does the first instance remove that message upon exit?

Does it use the GUID to identify the message?

newbieweb

Answer : Question about Windows messaging and this Mutex example

There is a system Mutex. The first thing the app does is check if this Mutex is available (i.e. no other app is running)
The GUID is simply the string name of the named Mutex.

The second thing it does is broadcast a custom windows message to all windows.  The running application see's this custom message and brings itself on top of all the other windows.

The GUID has nothing to do with the Windows message.

MAC
Random Solutions  
 
programming4us programming4us