Jump to content

Read data from Delphi TDBGrid control


skuja
 Share

Recommended Posts

I nead to read text from a window that has delphi grid component. I read here that it is impossible to read text from controls that are created with Delphi.

So the first solution for my problem that came in my is to create some kind of macros:

1)I click on the control:

ControlClick("myForm",cntrlId)

2)I send TAB command to move to the first cell of the grid

3)I send CTRL+C command to copy the text of a cell

4)I open my autoit form window

5)I add the copied contents in my form input control

The problem is that i cant find anywhere how to execute TAB, CTRL+C and CTRL+V commands to copy/paste the text.

Can someone show me some example code for this?

Is there any better approach to do this ?

Thanks in advance!

Link to comment
Share on other sites

Start with reading the help file and doing the basic tutorials, because you didn't even get the number of parameters for ControlClick() right. You key actions would be similar to:

ControlSend("myForm", "", $cntrlId, "{TAB}")
ControlSend("myForm", "", $cntrlId, "^c")
ControlSend("myForm", "", $cntrlId, "^v")

The complete description of send character strings is under Send() in the help file.

;)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Thanks for your usefull reply. But to my defence i wrote that function from my memories, just to show that i know how to get that far and i have read first few intro tuts i found in the wiki. And i do have opened documentation and i try to look for the answers there. Just missed to look under Send section and stuck in sendcontroll where those commands wasn't described. With all of this just wanted to say that i am not of that part of community who wants to post a "plzzz plzz help me do this.. " topics in the forum and wait for someone to do all the job for him, but in this case just didn't find my answer in documentation and asked for your help.

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