C
Code Monkey
I know one varient of this question has been posted a lot, but this
seems to be slighlty different.
I've got the following code in my application
<code>
[STAThread]
private static void Main()
{
bool createdNew;
string process_name =
Process.GetCurrentProcess().ProcessName.ToString();
Mutex m = new Mutex(true, process_name, out createdNew);
if (!createdNew)
{
return;
}
Application.Run(new Form1());
GC.KeepAlive(m);
}
</code>
whilst this works fine for a user logged onto a machine, it does NOT
work across multiple RDP connections.
Is it possible to detect if another user has already started an
application in another session? Or would I be better moving the entire
application into a service (its an order processing application) and
just displaying the GUI of the application to the user who attempts to
'start' the application?
seems to be slighlty different.
I've got the following code in my application
<code>
[STAThread]
private static void Main()
{
bool createdNew;
string process_name =
Process.GetCurrentProcess().ProcessName.ToString();
Mutex m = new Mutex(true, process_name, out createdNew);
if (!createdNew)
{
return;
}
Application.Run(new Form1());
GC.KeepAlive(m);
}
</code>
whilst this works fine for a user logged onto a machine, it does NOT
work across multiple RDP connections.
Is it possible to detect if another user has already started an
application in another session? Or would I be better moving the entire
application into a service (its an order processing application) and
just displaying the GUI of the application to the user who attempts to
'start' the application?