Jump to content

Activate a window which doesn't contain certain text


 Share

Recommended Posts

  • Developers

when there is a chance on multiple windows containing "abc" you could retrieve all titles With WinList() and do your own testing on the available windows and activating the one you need.

Something like :

$var = WinList()
;
For $i = 1 to $var[0][0]
    If StringInStr($var[$i][0],"Abc") And Not StringInStr($var[$i][0],"dfg") Then
        WinActivate($var[$i][1],"")
    EndIf
Next
Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

$array = Winlist()

For $x = 1 to $array[0][0]
If StringInStr($array[$x][0], "abc") And NOT StringInStr($array[$x][0], "dfg") then
WinActivate($array[$x][1])
Exitloop  ;optional, if you want it to exit after first window is found and activated
EndIf
Next

EDIT: Wow Jos. Are you reading my mind?

Edited by Paulie
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...