Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jun 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Communication between applications / Datagrid

    Hi all,

    I’m making an application which must access data in the windows of other applications (applications made by other companies).
    To find the window of the other applications I find the ‘Handle’ which allow Microsoft Windows to identify all the elements existing in the interface.

    My problem is that I can not access data available in components like dataGrid, stringGrid, … where MS Windows only see one handle of one window for the whole set of elements in the dataGrid.

    I use the software ‘Greatis Windowse’ to identify the ‘handle’ of each element (where I can see the class of the elements too). For example I can easily identify all those elements : the application main window, the text field, the button :



    So I can easily retrieve the text in the text area and force the click of the button [with PostMessage(TheHandle,WM_LBUTTONDOWN,MK_LBUTTON,0)]

    But with the same functions when I want to know information about the stingGrid, I have only one handle which identify the object in its whole entirety (whatever the part of the object I ask).



    I want to retrieve for example the text in the ‘B2’ box.
    How can I do that ? Any idea is welcome.

    Regards,


    DevWDApi

  • #2
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    So for the data grid, you only see one handle for the entire control?

    If so, you would just need to send the appropriate messages to get the data you want out of it. If the control was written by Microsoft, there should be some information on the MSDN. Failing that, you could use Spy++ to look at what messages it is sending and receiving.
    OracleGuy

  • #3
    Regular Coder
    Join Date
    Oct 2008
    Posts
    214
    Thanks
    5
    Thanked 22 Times in 22 Posts
    As I can see the app you are "sniffing" with WinDowse is a Delphi app. And the control you want to control is either a TStringGrid, TDataGrid or a TDBDataGrid. It is normal that each of there only have one handle for them since all of their row/cells are within the same object.

    I tried to search how to retrieve the content of one cell from that handle without success... I guess theres a way to get the cell content via the TSTringGrid's string(TStrings) property via the handle but I'm not sure... Try asking the forum here:
    https://forums.codegear.com/index.jspa

    What you are trying to achieve is somewhat hacky and may work (or not) in some situations only...


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •