Ian, I've created a few single instance WinForms apps. In the static Main I
do this skeleton code (which you've probably seen many times today):
bool createdNew;
appLocker = new Mutex(true, mutexName, out createdNew);
if (createdNew)
{
LaunchApp(); // Application.Run(new Form1()) wiz generated code
}
else
{
MessageBox.Show("Already running message");
// Use a Remoting pipe to tell the original app to activate or whatever
Application.Exit();
}
The mutex stuff is obvious, but when I researched this several years ago I
found the only reliable way of telling the original app to activate was to
use a pipe Remoting channel listener. I can drag out the old code that has
the two instances communicating if you need it. It sounds worse than it
really is and the Remoting code was acceptably small.
Greg