You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, thanks for sharing your program, i love it
I would suggest that you make it that only one instance can run at a time
internal static class Program
{
static Mutex mutex = new Mutex(true, "{B13D5A64-7F53-48A8-B022-3F65E35C1A1E}");
[STAThread]
public static void Main()
{
if (mutex.WaitOne(TimeSpan.Zero, true))
{
Application.SetCompatibleTextRenderingDefault(false);
Application.EnableVisualStyles();
Application.SetHighDpiMode(HighDpiMode.PerMonitorV2);
using WindowOpeningListener windowOpeningListener = new WindowOpeningListenerImpl();
windowOpeningListener.windowOpened += (_, window) => SecurityKeyChooser.chooseUsbSecurityKey(window);
foreach (SystemWindow fidoPromptWindow in SystemWindow.FilterToplevelWindows(SecurityKeyChooser.isFidoPromptWindow))
{
SecurityKeyChooser.chooseUsbSecurityKey(fidoPromptWindow);
}
_ = I18N.getStrings(I18N.Key.SMARTPHONE); // ensure localization is loaded eagerly
Application.Run();
}
else
{
// Notify the user and exit
MessageBox.Show("Another instance of the application is already running.");
}
}
}
The text was updated successfully, but these errors were encountered:
Hi, thanks for sharing your program, i love it
I would suggest that you make it that only one instance can run at a time
The text was updated successfully, but these errors were encountered: