Jump to content
max23ed

Make the text in winWait case sensitive

Recommended Posts

Hi, 

I know that i can set the title case sensitive using Opt() but can u make the text case sensitive too 

WinWait($title, $text)

Thanks.

Share this post


Link to post
Share on other sites

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

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

×
×
  • Create New...