Jump to content

How to Read Text value from Control Window


Recommended Posts

Hi Team,

 

I am unable to retrieve the text information present in my control section

Kindly help,I used

#include <MsgBoxConstants.au3>

Run("VIPUIManager.exe")
Local $iPID=WinWait("VIP Access","",3)
WinActivate($iPID,"")
ControlClick($iPID,"","[CLASS:Static; INSTANCE:6]")

ControlFocus($iPID,"","[CLASS:Static; INSTANCE:6]")

ControlGetHandle($iPID,"","[CLASS:Static; INSTANCE:6]")
ControlClick($iPID,"","[CLASS:Static; INSTANCE:6]")

Local $textval=ControlGetText($iPID,"","[CLASS:Static; INSTANCE:6]")
MsgBox($MB_OK,"title",$textval)
WinClose($iPID)

 

Its giving blank for msgbox

 

Thanks

AutoITCaptureText.PNG

Link to comment
Share on other sites

Link to comment
Share on other sites

@Danyfirex Correct me if I'm wrong but didn't he already try ControlGetText in his first post?

 

@narayan I don't see why ControlGetText wouldn't work, since the AutoIt Window Info Tool is able to get the text. If you can't get the text that way maybe an OCR solution would work? Not the best way to handle this of course but it might be worth a try.

Edited by Floops
Link to comment
Share on other sites

Try this:

Run("VIPUIManager.exe")
if WinExists("VIP Access") then 
    $sID = ControlGetText("VIP Access", "", "[CLASS:Static; INSTANCE:6]")
endif
ConsoleWrite($sID & @CRLF)

or

Run("VIPUIManager.exe")
$WW = WinWait("VIP Access")
$hWnd = WinGetHandle($WW)
$sID = ControlGetText($hWnd, "", "[CLASS:Static; INSTANCE:6]")
ConsoleWrite($sID & @CRLF)

or

#include <MsgBoxConstants.au3> 
Run("VIPUIManager.exe")
$WW = WinWait("VIP Access")
$hWnd = ControlGetHandle($WW, "", "[CLASS:Static; INSTANCE:6]")
$focus = ControlGetFocus("VIP Access")
$Text = ControlGetText($focus,"",$hWnd)
MsgBox($MB_OK,"Text", $Text)

Havent tried it.... :P:P:P

Edited by 232showtime
can you show the summary tab of autoit window info tool

ill get to that... i still need to learn and understand a lot of codes graduated.gif

Correct answer, learn to walk before you take on that marathon.

Link to comment
Share on other sites

Link to comment
Share on other sites

22 hours ago, Danyfirex said:

Hello.  This should work.

 

ControlGetText("VIP Access", "", "Static6")

Saludos

 

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