Jump to content
Sign in to follow this  
phew

Wildcards in WinGetTitle()

Recommended Posts

phew

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?

Share this post


Link to post
Share on other sites
poisonkiller

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

Share this post


Link to post
Share on other sites
phew

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

greetings

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  

×