Jump to content
Sign in to follow this  
athilann

how can i read a text from another application ?

Recommended Posts

athilann

Hii,

I try read a text from my application. I did used the commands "ControlGetText", "WinGetText" and "GUICtrlRead", but the return is always blank or 0.

I didnt found any example to help me. :

Have a way what i can do this?

Here is my code

WinWaitActive("SAC - Sistema de Atendimento ao Cliente")
Local $sText = ControlGetText("SAC - Sistema de Atendimento ao Cliente","","[CLASS:TspDateTimeCombo; INSTANCE:18]")
MsgBox(0, 'Texto da Tela', $sText)

Here is my application, the black box it's the text i want to read

Posted Image

Here it's the AutoIt Windows Info summary

>>>> Window <<<<

Title: SAC - Sistema de Atendimento ao Cliente

Class: TfsacMenu

Position: -8, -8

Size: 1616, 876

Style: 0x17CF0000

ExStyle: 0x00010100

Handle: 0x001504B6

>>>> Control <<<<

Class: TspCampoMascara

Instance: 54

ClassnameNN: TspCampoMascara54

Name:

Advanced (Class): [CLASS:TspCampoMascara; INSTANCE:54]

ID: 67934

Text:

Position: 400, 353

Size: 288, 20

ControlClick Coords: 130, 10

Style: 0x5C010000

ExStyle: 0x00000200

Handle: 0x0001095E

>>>> Mouse <<<<

Position: 530, 405

Cursor ID: 0

Color: 0xE8E8E8

>>>> StatusBar <<<<

>>>> ToolsBar <<<<

>>>> Visible Text <<<<

tlCliente

Cadastro de Atendimentos

SLA

/ / : :

/ / : :

/ / : :

/ / : :

/ / : :

/ / : :

08/03/2013 02:51:00 PM

08/03/2013 02:51:00 PM

/ / : :

/ / : :

Contrato

Atendimento cadastrado com versão em Homologação

/ / : :

/ / : :

/ / : :

/ / : :

SLA Interno

/ / : :

SLA esta parada

14/03/2013 06:00:00 PM

Possui SLA

/ / : :

Atend. Priorizado

07/03/2013 11:30:45 AM

SLA possui início automático

bfBarraCadastro

>>>> Hidden Text <<<<

Inicio Auto

sla parado

Ca&dastro

Rateio Padrão

Descrição interna

Descrição da solicitação

Tela Sistema: Tela Selenium

Descrição: Teste Selenium

Possui SLA

14/03/2013 06:00:00 PM

SLA esta parada

Aceito

/ /

07/03/2013 11:30:45 AM

Divulgar na RAV

14/03/2013 06:00:00 PM

/ /

Encerr&amento

Destaque

14/03/2013 06:00:00 PM

ok

Notificar o cliente por e-mail

08/03/2013 02:50:57 PM

Histórico do Atend.

Padrão

Orçamento / Requisitos

Alterar Faturamento

/ / : :

/ /

07/03/2013 11:30:45 AM

Salts Vinculadas

&Versão

C&onsulta

spButton1

Share this post


Link to post
Share on other sites
FireFox

Hi,

Welcome to the autoit forum :)

Try this:

#include <GUIComboBox.au3>

Local Const $hCombo = ControlGetHandle("SAC - Sistema de Atendimento ao Cliente", "", "[CLASS:TspDateTimeCombo; INSTANCE:18]")
If $hCombo = 0 Then Exit(1)

ConsoleWrite(_GUICtrlComboBox_GetEditText($hCombo) & @CrLf)

Br, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
athilann

Thanks for the help, but this code return the blank.

It found the handle, but it dont read the text.

Other way.

I managed read the field in the black box in the image

I don't understand the difference. Because is the only field what that i can read the text in the application. (it's a checkbox).

i can read this field with the commands "ControlGetText", "WinGetText" and "GUICtrlRead".

Posted Image

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.