When starting a vb app, I am using the following code to detect if an instance of the application is already running.
If App.PrevInstance = True Then
This works, but not really in the way i want it to work. If a previous instance of the application is running, i want it to be made the active window, and if it is minimized, i want to be able to restore the application window, so that it is the active window. The above code detects if the application is already running, but doesn't actually activate it, infact i dont think the appactivate command does anything at all. Also, i have coded the application such that when minimized, it appears in the system tray, and not on the taskbar, so i would want it to be restored from the system tray if minimized.
I have spent hours on this trying various things, and i'm sure its something simple, can anyone help? Thanks.