I need to interact with another application, that resides in the tray. I'm currenty using TestStack White this way:
ProcessStartInfo processStartInfo = new ProcessStartInfo("MyProg.exe");
Application application = Application.AttachOrLaunch(processStartInfo);
_window = application.GetWindows()[0];
Everything works if the application was not running before this call, since launching it, this is visible.
Instead, if the application was already running, and in the tray, White could not find any window, and I can see this in the console as the following log:
Could not find any windows for this application
...and, after some retries, it fails with an exception. Now, the best solution I found is to kill the application and relaunch it:
application.Kill();
application = Application.Launch("MyProg.exe");
and this works. But I guess there is a better solution to this.