Holy
Holy

Reputation:

How to hide an external program's windows programmatically?

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?

Upvotes: 2

Views: 1382

Answers (3)

Nick Dandoulakis
Nick Dandoulakis

Reputation: 43110

ShowWindow(FindWindow(NULL, "WINDOW TITLE"), SW_HIDE);

Upvotes: 1

Simon P Stevens
Simon P Stevens

Reputation: 27499

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.

Upvotes: 3

Greg Hewgill
Greg Hewgill

Reputation: 993085

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.

Upvotes: 4

Related Questions