Jump to content

Make the text in winWait case sensitive


max23ed
 Share

Recommended Posts

Yes like this.  Read your thread with Chrome and test it :

#include <Constants.au3>

Opt ("MustDeclareVars", 1)
Opt ("WinTitleMatchMode", 2)

MsgBox ($MB_SYSTEMMODAL,"This work",WinWaitCaseSensitive ("Make the text", "Chrome Legacy", 10))
MsgBox ($MB_SYSTEMMODAL,"This do not work",WinWaitCaseSensitive ("Make the text", "CHROME Legacy", 10))

Func WinWaitCaseSensitive ($sTitle, $sText, $iDelay = 0)
  Local $aList = WinList ($sTitle, $sText)
  For $i = 1 to $aList[0][0]
    ;ConsoleWrite (WinGetText ($aList[$i][0]) & @CRLF)
    If StringInStr (WinGetText ($aList[$i][1]), $sText, 1) Then Return WinWait ($aList[$i][1], "", $iDelay)
  Next
  Return 0
EndFunc

ps. you still have to manage the case where $sTitle is a handle...

Edit : optimized code

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