Sign in to follow this  
Followers 0
sheck

Cannot hide a window

5 posts in this topic

#1 ·  Posted (edited)

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



#2 ·  Posted (edited)

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

[center]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.[/center]

Share this post


Link to post
Share on other sites

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

Don't forget that ).

Share this post


Link to post
Share on other sites

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

#5 ·  Posted (edited)

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  
Followers 0