Jump to content

How recognize event click of a Tedit object?


Silvinho
 Share

Recommended Posts

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

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