Jump to content

How Do I Detect The Active Window Is A Windows Explorer Window?


Recommended Posts

  • Moderators

Here this works:

While 1
    If _ExploreWinActive() Then
        MsgBox(0, 'Active', 'Explorer Window Active')
    EndIf
    Sleep(10)
WEnd

Func _ExploreWinActive()
    $OPT_TitleMode = Opt('WinTitleMatchMode', 4)
    If WinActive('classname=ExploreWClass') Then
        Opt('WinTitleMatchMode', $OPT_TitleMode)
        Return 1
    EndIf
    Opt('WinTitleMatchMode', $OPT_TitleMode)
EndFunc

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

  • Moderators

SmOke_N, Strange as my explorer windows are of Class: CabinetWClass on XP SP2 :) . Once I change the Class, then your code works well.

Really? XP Pro SP2 here... hmm

Edit: Actually now that I think about it, that doesn't surprise me. The build is old I believe (2002 if I'm not mistaken).

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

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...