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.");
}
}
}
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