Jump to content

Recommended Posts

Posted

Hi,

i got a problem with following code:

$title = WinGetTitle("FileZilla")

If ($title = "*verbunden*") Then
    MsgBox(0, "Title (Connected!)", $title)

ElseIf ($title = "*version*") Then
    MsgBox(0, "Title (Not connected!)", $title)
    
Else
    MsgBox(0, "Title", "error")
    
EndIf

i want to check with wildcards if the word "verbunden" or "version" is anywhere in the window's title but i got some problems with the wildcard thingy, i guess it doesnt accept the '*'s as wildcards in this function. any idea?

Posted

Try this:

$title = WinGetTitle("FileZilla")

If StringInStr($title, "verbunden") Then
    MsgBox(0, "Title (Connected!)", $title)

ElseIf StringInStr($title, "version") Then
    MsgBox(0, "Title (Not connected!)", $title)
    
Else
    MsgBox(0, "Title", "error")
    
EndIf
Posted

Oh, thank you very much, i guess didn't read the F1-Help carefully, i was searching for something like this :)

greetings

  • Administrators
Posted

You can also use regular expressions in window titles in order to do wildcard (or more complicated) matches.


 

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
×
×
  • Create New...