Nareshm

ControlGetText Not Working

7 posts in this topic

#1 ·  Posted

I'm trying to use ControlGetText to read that static control and get the text. The Au3Info for the control is as follows:

>>>> Window <<<<
Title:     PS .2.0  - [PS Bill]
Class:    WindowsForms10.378734a
Position:    -8, -8
Size:    1382, 744
Style:    0x17CD0000
ExStyle:    0x00050100
Handle:    0x0000000000140984

>>>> Control <<<<
Class:    WindowsForms10.378734a
Instance:    1
ClassnameNN:    WindowsForms10378734a1
Name:    txtNo
Advanced (Class):    [NAME:txtNo]
ID:    1444318
Text:    
Position:    219, 76
Size:    175, 30
ControlClick Coords:    91, 19
Style:    0x5E0100C0
ExStyle:    0x00000200
Handle:    0x00000000001609DE

>>>> Mouse <<<<
Position:    310, 137
Cursor ID:    0
Color:    0xF0F0F0

>>>> StatusBar <<<<

>>>> ToolsBar <<<<

>>>> Visible Text <<<<
MenuStrip
               :: NAME :- PS Bill
.

>>>> Hidden Text <<<<

i tried with following code :

ControlGetText("PS .2.0  - [PS Bill]", "", " [NAME:txtNo]")

But not working

Share this post


Link to post
Share on other sites



#2 ·  Posted

Try using "[CLASSNN: WindowsForms10378734a1]" as the 2nd parameter.

Share this post


Link to post
Share on other sites

#3 ·  Posted

2 minutes ago, Danp2 said:

Try using "[CLASSNN: WindowsForms10378734a1]" as the 2nd parameter.

i am tried with it but not working

Share this post


Link to post
Share on other sites

#4 ·  Posted

Stripping the first space?

" [NAME:txtNo]"

Conrad


SciTE = 3.6.2.0/full   AutoIt = 3.3.14.2   AutoItX64 = 0   OS = Win7Pro SP1   OSArch = X64   Language = 0407/german
H:\...\AutoIt3\SciTE   H:\...\AutoIt3   H:\...\AutoIt3\Include   H: = Network Drive

   88x31.png  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind.

Share this post


Link to post
Share on other sites

#5 ·  Posted

It's up to you to troubleshoot the issue to figure out why it isn't working as expected. You can't just come on here and say "It's not working" and then someone will miraculously solve the issue for you.

Why isn't it working? Either the window title is wrong or the text identifier is wrong. So how to figure it out? First thing I would do is test the window title, like this:

$wintitle = "PS .2.0  - [PS Bill]"

If WinExists($wintitle) Then
    ConsoleWrite("Window found!" & @CRLF)
Else
    ConsoleWrite("Window NOT found!" & @CRLF)
EndIf

 

Share this post


Link to post
Share on other sites

#6 ·  Posted

31 minutes ago, Danp2 said:

It's up to you to troubleshoot the issue to figure out why it isn't working as expected. You can't just come on here and say "It's not working" and then someone will miraculously solve the issue for you.

Why isn't it working? Either the window title is wrong or the text identifier is wrong. So how to figure it out? First thing I would do is test the window title, like this:

$wintitle = "PS .2.0  - [PS Bill]"

If WinExists($wintitle) Then
    ConsoleWrite("Window found!" & @CRLF)
Else
    ConsoleWrite("Window NOT found!" & @CRLF)
EndIf

 

Do nothing with this script

Share this post


Link to post
Share on other sites

#7 ·  Posted

5 minutes ago, Nareshm said:

Do nothing with this script

This is what I see when I run the script --

>"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "C:\Users\Dan\Dropbox\test7.au3" /UserParams    
+>10:31:19 Starting AutoIt3Wrapper v.17.224.935.0 SciTE v.3.7.3.0   Keyboard:00000409  OS:WIN_10/  CPU:X64 OS:X64  Environment(Language:0409)  CodePage:0  utf8.auto.check:4
+>         SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE   UserDir => C:\Users\Dan\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper   SCITE_USERHOME => C:\Users\Dan\AppData\Local\AutoIt v3\SciTE 
>Running AU3Check (3.3.14.2)  from:C:\Program Files (x86)\AutoIt3  input:C:\Users\Dan\Dropbox\test7.au3
+>10:31:19 AU3Check ended.rc:0
>Running:(3.3.14.2):C:\Program Files (x86)\AutoIt3\autoit3.exe "C:\Users\Dan\Dropbox\test7.au3"    
--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
Window NOT found!
+>10:31:19 AutoIt3.exe ended.rc:0
+>10:31:19 AutoIt3Wrapper Finished.
>Exit code: 0    Time: 0.5597

Note the line that says "Window NOT found!", which is what I would expect in my environment.

Are you running the script in SciTE? If not, please do so and post the results from the output window.

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