views:

240

answers:

3

I want to hide an external application, ie. not the current application. I want to give the title of the application and it will be hidden. How can I do this programmatically?

+4  A: 

In general terms, you could call FindWindow to get the HWND of the window in question, then ShowWindow with SW_HIDE to hide the window.

Greg Hewgill
You beat me to it =:)
Simon P Stevens
+3  A: 

You need to get a handle to the window (which you can do using FindWindow()). Then you need to call ShowWindow() and set it's shown state to hidden.

Simon P Stevens
+1  A: 
ShowWindow(FindWindow(NULL, "WINDOW TITLE"), SW_HIDE);
Nick D