how to open only single instance of electronnet exe #523

Closed
opened 2026-01-29 16:41:55 +00:00 by claunia · 2 comments
Owner

Originally created by @jadhavrani123 on GitHub (Jun 27, 2020).

Originally assigned to: @GregorBiswanger on GitHub.

Hello Sir,
I am trying to open only one instance of app window.I am setting option in electron.manifest.json file singleinstance=true,
It works but when my exe is in system tray it doesnt get open when click on exe icon.I want your help for that problem.Means when I click on exe icon the same window should get open which is in system tray.

Originally created by @jadhavrani123 on GitHub (Jun 27, 2020). Originally assigned to: @GregorBiswanger on GitHub. Hello Sir, I am trying to open only one instance of app window.I am setting option in electron.manifest.json file singleinstance=true, It works but when my exe is in system tray it doesnt get open when click on exe icon.I want your help for that problem.Means when I click on exe icon the same window should get open which is in system tray.
Author
Owner

@ThuCommix commented on GitHub (Sep 1, 2020):

You can pass a delegate to Electron.App.RequestSingleInstanceLockAsync which will get called with the arguments (if any) of the new opened instance. In that delegate you need to restore the focus & visibility of your desired window.

@ThuCommix commented on GitHub (Sep 1, 2020): You can pass a delegate to Electron.App.RequestSingleInstanceLockAsync which will get called with the arguments (if any) of the new opened instance. In that delegate you need to restore the focus & visibility of your desired window.
Author
Owner

@GregorBiswanger commented on GitHub (Mar 28, 2023):

🎉🚀 New Electron.NET version 23.6.1 released 🚀🎉

With native Electron 23 and .NET 6 support. Your problem should be fixed here. If you continue to have the problem, please let us know. Please note the correct updating of your API & CLI. Info in the README. Have fun!

@GregorBiswanger commented on GitHub (Mar 28, 2023): 🎉🚀 New Electron.NET version 23.6.1 released 🚀🎉 With native Electron 23 and .NET 6 support. Your problem should be fixed here. If you continue to have the problem, please let us know. Please note the correct updating of your API & CLI. Info in the README. Have fun!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Electron.NET#523