Jump to content
Sign in to follow this  
GordonFreeman

I cannot get the text of control

Recommended Posts

GordonFreeman

Posted Image

Note: The black border indicates "finder tool" of Autoit Window Info.

My goal is to pass the information from one catalog to another.

but just locked myself in the bar code

I tried in many ways with the ControlGet Text but only returns a blank string

The Info:

I need the of first code (bar code)

>>>> Window <<<<

Title: ACM - ACM-002

Class: WindowsForms10.window.8.app.0.2bf8098_r13_ad1

Position: 150, 21

Size: 800, 482

Style: 0x16C90000

ExStyle: 0x00050101

Handle: 0x000E04EA

>>>> Control <<<<

Class: WindowsForms10.SysListView32.app.0.2bf8098_r13_ad1

Instance: 3

ClassnameNN: WindowsForms10.SysListView32.app.0.2bf8098_r13_ad13

Name: ListView_Originais

Advanced (Class): [NAME:ListView_Originais]

ID: 67774

Text:

Position: 218, 331

Size: 577, 122

ControlClick Coords: 393, 47

Style: 0x5601004D

ExStyle: 0x00000200

Handle: 0x000108BE

>>>> Mouse <<<<

Position: 764, 424

Cursor ID: 0

Color: 0xF0F0F0

>>>> StatusBar <<<<

>>>> ToolsBar <<<<

>>>> Visible Text <<<<

0

REGULADOR DE VOLTAGEM 14V 55A

Foto2

Foto1

Código:

Grupo:

ACM

Fechar

PC

Unid.:

0

25,23

Total:

Valor:

ACM-002

Qtd:

Aplicações

Equivalências

>>>> Hidden Text <<<<

Edited by GordonFreeman

Share this post


Link to post
Share on other sites
Spiff59

So have you tried ControlListView()?

Share this post


Link to post
Share on other sites
GordonFreeman

The joy was short xD. Now there is another problem. I need bar code (Código de Barras) but not always it is the first, the manufacter code (Código Fabricante) is the first sometimes.

See:

Posted Image

Share this post


Link to post
Share on other sites
Spiff59

You can use the "GetItemCount" command of ControlListView() to determine the number of rows, if the number of columns vary, you can use the "GetSubItemCount" command. Then you can use for/next loops and "GetText" (with item/subitem options) to read each cell of the listview. I guess for each row, reading subitem 2 "Tipo", would tell you what the value in subitem 0 represents.

Edited by Spiff59

Share this post


Link to post
Share on other sites
GordonFreeman

Thanks man! I succeeded to doing this:

For $Count = 0 to 10
$BARRAS = ControlListView($TituloJanela, "", "[NAME:ListView_Originais]", "GetText", $Count, 2)
If $BARRAS = "Código de Barras" Then
$CODIGO_BARRA = ControlListView($TituloJanela, "", "[NAME:ListView_Originais]", "GetText", $Count, 0)
ExitLoop
EndIf

The list only has 30,000 items. Make the hand is bad. =D

Edited by GordonFreeman

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
Sign in to follow this  

×