Sign in to follow this  
Followers 0
Guest rathore

A Quick Question

7 posts in this topic

How do i find out the classname (not handle) of the active window?

Thanx.

-Rathore

Share this post


Link to post
Share on other sites



i'm sorry i should've been more clear. i want to do this in a script. like every explorer window has a different title (depending on the folder open) but has the same classname.

i wanted to check if the active window is an explorer window ( classnames CabinetWClass or ExploreWClass)

thanx!

Share this post


Link to post
Share on other sites

There probably should be a WinGetClass function but you can work around it by doing something like:

If WinActive("classname=CabinetWClass") Then
...
specified class is active
...
EndIf

Share this post


Link to post
Share on other sites

uh Jon, does that really work?

this is what i tried:

sleep (2000)
If WinActive("classname=CabinetWClass") Then
    TrayTip ( "yes", "it works!",1)
    sleep (1000)
Else
EndIf

in the initial delay i'd manually activate a folder window... but nothing happened!

is it something that i'm doing wrong?

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

GOD! u r really a FastShooter Jon! :whistle: I did come online just to post that I found out what I missed:

AutoItSetOption ( "WinTitleMatchMode", 4 )

( look at the time! just 3 mins after my post u've answered it!!)

Thanx!!!

Edited by rathore

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