Jump to content

Check if active window is what u want

Recommended Posts

maybe this can help

Dim $num, $names
$var = WinList()

For $i = 1 to $var[0][0]
; Only display visble windows that have a title
  If $var[$i][0] <> "" AND IsVisible($var[$i][1]) Then
    $num = $num + 1
    $names = $names & $var[$i][0] & @CRLF

Func IsVisible($handle)
  If BitAnd( WinGetState($handle), 2 ) Then
    Return 1
    Return 0


MsgBox(0, "Total Windows = " & $num, "Title's of all task bar Windows" & @CRLF & @CRLF & $names & "   ")


Edited by Valuater


Link to comment
Share on other sites

  • Moderators

While he's making a long script, you could try this:

MsgBox(0, 'test', WinGetTitle(''))


After reading this again, I don't think I'm following correctly...

HotKeySet('{end}', 'testtitle')
While 1
Func testtitle()
    If StringInString(WinGetTitle(''), 'text in title I want') Then MsgBox(0, 'test', WinGetTitle(''))
This picks the active windows title, and then matches a string in it, if the statement is true, then the msgbox will appear... Is the right direction, or does Valauter have you on the right path? 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

  • Recently Browsing   0 members

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