Class AppSingleInstance
Implements "single instance process" feature.
public static class AppSingleInstance
Examples
/*/ role exeProgram; ifRunning run; /*/
if (script.testing) args = ["test", "args"];
if (AppSingleInstance.AlreadyRunning("unique-mutex-name", args)) {
print.it("already running");
return;
}
var b = new wpfBuilder("Window").WinSize(400);
b.R.AddOkCancel();
b.End();
AppSingleInstance.Notified += a => {
print.it("AppSingleInstance.Notified", a);
b.Window.Activate();
};
if (!b.ShowDialog()) return;
Namespace: Au.More
Assembly: Au.dll
Methods
Name | Description |
---|---|
AlreadyRunning(string, IEnumerable<string>, int) | Detects whether a process of this app is already running. |
Events
Name | Description |
---|---|
Notified | When AppSingleInstance.AlreadyRunning in new process detected that this process is running. Receives notifyArgs passed to it. |