1
Reply

Trying to write a fullscreen application launcher, Can't get window to restore after quitting launched application

peter lu

peter lu

Sep 3 2010 8:03 PM
2.5k
Hi, I'm trying to write a kiosk type software that launches applications under windows 7.

Everything is working great except that the launcher software should (ideally) be run fullscreen. Whenever it launches another application it minimizes and when that program quits the launcher application does not restore. I'm not using the system forms so I can't use the restore option in the form class. I did a bunch of searches on google and they all told me to dllimport user32.dll and use functions like SetFocus, ShowWindow, and AnimateWindow and apply it to GetCurrentProcess().MainWindowHandle. After debugging a bit I'm certain that GetCurrentProcess() is working (because I do the kill() function and it works as expected) but MainWindowHandle is always 0. I also started a few different processes using Process.Start() and all those also had MainWindowHandle as 0. I'm out of ideas now. 

Any help would be much appreciated.

Answers (1)