.netsystrayshowwindow

How to restore an application from the SysTray? ShowWindow doesn't help since the Handle=0


Is it possible to restore a 3rd Party application which has been minimized to the SysTray?

Calling ShowWindow is fine on apps minimized to the TaskBar but where the app has been minimized to the SysTray it appears its handle gets set to zero, and of course ShowWindow can't find it.


Solution

  • Helpful advice from Adam Robinson and nobugz. Helped me to see that what we are attempting might not even be possible. Too much depends on how the app is behaving internally when it hides itself and we don't control that or even know much about it. We needed to approach this from another direction.

    The app sits in the SysTray waiting to be activated via the user mouse clicking on it, but we can't automate that. But there's another way of "activating" the app and that's by running the exe file again. In this case, that doesn't start a second instance, it just reactivates the existing instance. So why not Shell out to the exe file and reactivate the app that way? That's what we did and it is a working solution.