Jump to content
Sign in to follow this  
Silvinho

How recognize event click of a Tedit object?

Recommended Posts

Silvinho

It would like to know how to recognize an edit object without the property text, in other words, when property text is ""?.

I tried to use ControlClick, but the ID of this object is dynamic. How I do to it recover the ID of a Tedit store in a variable and to use in ControlClick?

ControlClick("My Window", "", "[iD:254]")

If I use ControlClick("My Window", "", "[CLASS:Button; TEXT:Finish; INSTANCE:2]"), is not possible to recognize the event in this object because the property text = "". it Only is possible to do it if the property Text has some value..

Share this post


Link to post
Share on other sites
dani

It would like to know how to recognize an edit object without the property text, in other words, when property text is ""?.

I tried to use ControlClick, but the ID of this object is dynamic. How I do to it recover the ID of a Tedit store in a variable and to use in ControlClick?

ControlClick("My Window", "", "[iD:254]")

If I use ControlClick("My Window", "", "[CLASS:Button; TEXT:Finish; INSTANCE:2]"), is not possible to recognize the event in this object because the property text = "". it Only is possible to do it if the property Text has some value..

If you create an Edit like this

$Edit = GUICtrlCreateEdit("", 0, 0),

Your $Edit variable holds the ControlID of the Edit Control.

In other words, for example GUICtrlDelete($Edit) will remove the Edit Control.

Please read the documentation first ...

Success: Returns the identifier (controlID) of the new control.

Failure: Returns 0.

Edited by D4ni

Share this post


Link to post
Share on other sites
martin

If you create an Edit like this

$Edit = GUICtrlCreateEdit("", 0, 0),

Your $Edit variable holds the ControlID of the Edit Control.

In other words, for example GUICtrlDelete($Edit) will remove the Edit Control.

Please read the documentation first ...

It looks a bit rich as an observer that you should tell Silvinho to read the documentation when you don't appear to have read his/her post.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites
Silvinho

But I do not want to create an edit, want to recognize a Tedit of an application in Delphi..

I need take the Handle of this object!.

[

quote name='D4ni' date='Nov 19 2007, 08:01 PM' post='435512']

If you create an Edit like this

$Edit = GUICtrlCreateEdit("", 0, 0),

Your $Edit variable holds the ControlID of the Edit Control.

In other words, for example GUICtrlDelete($Edit) will remove the Edit Control.

Please read the documentation first ...

Share this post


Link to post
Share on other sites
martin

If I use ControlClick("My Window", "", "[CLASS:Button; TEXT:Finish; INSTANCE:2]"), is not possible to recognize the event in this object because the property text = "". it Only is possible to do it if the property Text has some value..

I'm not sure you're correct about that. I would expect "[CLASS:Tedit; INSTANCE:1]" would work.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites
dani

It looks a bit rich as an observer that you should tell Silvinho to read the documentation when you don't appear to have read his/her post.

My apologies. I must have interpreted the "Edit Object" as "Edit Control", which obviously led me to GUICtrlCreateEdit :P

Share this post


Link to post
Share on other sites
Silvinho

Run("CadCli.exe")

$file = FileOpen("c:\temp\Familia.txt", 0)

Thank you, I Got..

I need just to read a txt file that contains two columns and to type in other Tedit with the Age name.

; Check if file opened for reading OK

If $file = -1 Then

MsgBox(0, "Error", "Unable to open file.")

Exit

EndIf

While 1

$line = FileReadLine($file)

If @error = -1 Then ExitLoop

WinWaitActive("Cadastro de Clientes")

ControlClick("Cadastro de Clientes", "", "[CLASS:TEdit;INSTANCE:2]")

Send($line)

ControlClick("Cadastro de Clientes", "", "[CLASS:TButton; TEXT:Gravar; INSTANCE:2]")

Send("{ENTER}")

Wend

FileClose($file)

I'm not sure you're correct about that. I would expect "[CLASS:Tedit; INSTANCE:1]" would work.

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  

×