Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

help, a program that will hide the windows ?

Status
Not open for further replies.

mrpres

Programmer
Apr 24, 2003
2
US
I am trying to make a program that will hide the windows of any app. I have seen this done by an app called momshell...but I want to make it better and free. I have obtained the handle of the active window by using GEtActiveWindow() then used ShowWindow(hWnd, int) to try to alter the show status to 0 (hidden) but it only seems to work on the app's windows not other windows...if any one could offer insight or knows of another way to achieve this plz let me know. I know that windows passes 4 parameters to an app the hInstance, hPrevInstance, string (the command line options), int iCmdShow. That last variable is the preferred value for windows to start as (0 being hidden) I do not know how to tell windows to specify a specific value for this parameter when it launches an app (this could also work if the compiled app supports it). Any info at all will be appreciated.
 
MSDN library says:
"The GetActiveWindow function retrieves the window handle to the active window attached to the calling thread's message queue."

so it seems that since your calling thread is your main program, those window handles will be ones in your program only.

You might be able to do it with EnumWindows(). I've never used it but it looks like you need to set up a callback function which you pass to EnumWindows() which is then called as each window is found. In that function you can try ShowWindow(h , SW_HIDE);

Just a guess.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top