John,
I misread this the last time you asked it. I understand now what you're
trying to do.
What you have to do is, rather than the new instance trying to restore the
existing instance, the new instance should send a WM_SETTEXT Windows message
from the new instance to the original instance using the SendMessage API
function. This way you can send a specifically coded text message to the
original application. The original application can be programmed to
recognize this code and, in response, restore itself properly.
Hope this helps.
Dale
"John" <so@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I use NotifyIcon to minimize my app to the system tray. I also check
everytime my app runs for the previous instance, if it is running, call
SetForegroundWindow to bring its window up front and exit the second
instance.
The problem is it doesn't bring the app out of the system tray. It works
fine if the app is NOT in the system tray. How do I bring it out of the
system tray and make it an active window? Thanks