Jump to content
Sign in to follow this  
sheck

Cannot hide a window

Recommended Posts

sheck

AutoItSetOption("WinTitleMatchMode", 4)

$whandle = "handle=" & WinGetHandle("active", "")
WinSetState($whandle, "", @SW_HIDE)

The above code gets the window handle, but doesn't hide the window at all. I need to hide a window using it's handle or classname and cannot use "active", "last", "" or title of the window to hide it in my program that I'm making, because title and state of windows are variables and handle doesn't change as long as the window is open and that's what I need.

So, is there another way to get a window handle or classname. Or maybe there is another way of hiding windows.

Edited by sheckandar

Live and Learn, 'cause Knowledge is Super Power.

Share this post


Link to post
Share on other sites
SmOke_N

Notice where and how you put the class name:

AutoItSetOption("WinTitleMatchMode", 4)
$whandle = WinGetHandle("classname=Class", "")
Sleep(1000)
WinSetState($whandle, "", @SW_HIDE)
Sleep(1000)
WinSetState($whandle, "", @SW_SHOW)

Edit: Forgot a bracket :lmao:

Edited by SmOke_N

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
greenmachine

...
WinSetState($whandle, "", @SW_SHOW)

Don't forget that ).

Share this post


Link to post
Share on other sites
sheck

Thanks, it worked. Guess manuals are not always accurate.


Live and Learn, 'cause Knowledge is Super Power.

Share this post


Link to post
Share on other sites
Sandro Alvares

SmOke_N, is good your source... i try make MSN Messenger is work a class name is IMWindowClass

Thanks :lmao:

Edited by Sandro Alvares

Programmer PHP, ASP, CGI, Perl, Delphi, JScript, ......... :)

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  

×