I have a singleton application that can be minimized to the system tray. It can happen that the user starts another instance of the application, and with _singleton
I detect the first instance of the script and I activate the window before exiting the new instance.
However when the first instance is hidden with GUISetState(@SW_HIDE)
the first instance is not showing up. I tried to get the window handle, but no success.
How can I unhide the first instance?
Consider the below code snippet:
If _Singleton("MyApp.exe", 1) = 0 Then
GUISetState(@SW_SHOW, WinGetHandle("MyApp.exe"))
WinActivate("MyApp")
Exit
EndIf