Jump to content

Cannot hide a window


sheck
 Share

Recommended Posts

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.
Link to comment
Share on other sites

  • Moderators

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.

Link to comment
Share on other sites

  • 2 weeks later...

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...