Jump to content

Wildcards in WinGetTitle()


Recommended Posts

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?

Link to comment
Share on other sites

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