Jump to content

WinGetText text match


 Share

Recommended Posts

Hi

How can i do text match on current active window like im using this code but its nt working prperly

$text=WinGetText("" , "mykeyword")  
if $text   then
MsgBox(0 , "" , "FOUND")
EndIf
$sHwnd = WinGetHandle("")
$sText = WinGetText($sHwnd)
If StringInStr($sText,"mykeyword") Then
MsgBox(0, "", "FOUND")
EndIf
Edited by Manadar
Link to comment
Share on other sites

Thanks dude and wat if need to get multiple keywords like mykeyword1 mykeyword2 mykeyword3

well this works for me any way better or faster then this or it allright ?

$sHwnd = WinGetHandle("")
$sText = WinGetText($sHwnd)
If StringInStr($sText,"mykeyword") or StringInStr($sText,"mykeyword1") Then
MsgBox(0, "", "FOUND")
EndIf
Edited by autoitxp
Link to comment
Share on other sites

Thanks dude and wat if need to get multiple keywords like mykeyword1 mykeyword2 mykeyword3

well this works for me any way better or faster then this or it allright ?

$sHwnd = WinGetHandle("")
$sText = WinGetText($sHwnd)
If StringInStr($sText,"mykeyword") or StringInStr($sText,"mykeyword1") Then
MsgBox(0, "", "FOUND")
EndIf
That is just fine. :)
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...