I don't know about a Microsoft standard for such a thing but I have recently
looked up the same thing and found the following approach:
Basically you use a uniquely named Mutex, upon app initialization you check
to see if the mutex is already created, and if it is then you know an
instance of that app is already running.
At that point you can throw up a message. As for then switching to the
original instance I have no idea. One may be able to have some shared memory
between the apps protected by said mutex that stores any information needed
to know about the other app and hence having the info needed to activate the
window for the other app?
Post by anealc
I am creating an application which is only allowed to run on Windows once.
user attempts to invoke a second instance this second instance shows a
message to the effect that the program is already running, before switching
to the original instance.
My question is that is there a Microsoft standard for this behaviour? The
only Microsoft app that I can think of that does this is Media Centre, but
that doesn't show any message.