Jump to content
Sign in to follow this  

How to hide mulitple windows at once?

Recommended Posts


Hi guys!

Can you please help us with this one?

The open source software can be found in

this site:


If you have time to explore and run the program,please let me know.

We would like to modify the open source program. We would like also to implement the setting of a hotkey to hide same applications. For example, you have 2 opened windows of "notepad",by setting a hotkey for the same applications, you can simultaneously hide them. Let's say you have 5 same windows, you don't need to set a hotkey for each window.

Here is the function named "hide" (originally based from WaT-Without a Trace software). It hides only a single application to where there is an assigned hotkey set by the user.We tried to add some lines in asking for user's password to hide an application. And the other thing we would like to add is the hiding of multiple widows of same applications at once.

How can we hide same applications at once?

Using the code snippet, how are we going to do this?


Func hide()

$window = WinList()

$text2 = InputBox("SHOW WINDOW PASSWORD", "Type your password to show window!","","*")

For $i = 1 to $window[0][0]

If $window[$i][0] <> "" And IsVisible($window[$i][0]) And _

$window[$i][0] <> "HAT - 'Hide Application Tool'" And _

$window[$i][0] <> "Program Manager" And _

$window[$i][0] <> "lock" Then

$captured[$count] = $window[$i][0]

$count = $count + 1

WinSetState($window[$i][0], "", @SW_HIDE)

If BitAND(WinGetState($window[$i][0], ""), 2) Then

WinSetState($window[$i][0], "", @SW_HIDE)





If WinExists("HAT - 'Hide Application Tool'") Then update_lists()

EndFunc ;==> hide

;---------------------------------------------------------------------------end of func------------------------------------------------------------------------------------------

That would be all.


Share this post

Link to post
Share on other sites

Multiple instances of an application might have the same title in $Window[$i][0], but will still have unique HWND "handles" in $Window[$i][1]. Use the handles to manipulate the windows, it's more reliable.


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post

Link to post
Share on other sites

Keep it to one thread.


And you were warned here on the same issue: http://www.autoitscript.com/forum/index.ph...c=64791&hl= as well.

Next time you can expect to be banned for spamming.

As PSaltyDS has pointed out, the hwnd (handle) of the window never changes and is unique to its specific instance. Also as the $hWndToHide << Variable name I gave my example would point out, but for someone that doesn't understand that I can understand how you would miss that.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this