locked
Extracting Text from a Dialog Window

    Question

  • How can I extract text from an existing Dialog Window? Its a 3rd party dialog window so I don't have the source code of it. I have to extract text from its Lables and Text box. I think for extracting text from TextBox we can use WM_COPYDATA message (Not sure) But how can I extract text from labels of a dialog Window?


    Adeel


    Tuesday, May 15, 2012 4:55 AM

Answers

  • For static text (label), and Edit boxes, send WM_GETTEXT.  Do not use GetWindowText() since this does not work across different processes.
     
    This does not work with Common Controls, and messages such as LVM_GETITEMTEXT, which requires the caller to be within the same process.  For this, use SendMessageRemote instead:  http://www.ucosoft.com/get-clistctrl-item-text-of-another-process. html
     
    -- David
     

    Efficiently read and post to forums with newsreaders: http://communitybridge.codeplex.com
    • Marked as answer by maverick786us Tuesday, May 15, 2012 5:20 AM
    Tuesday, May 15, 2012 5:13 AM

All replies

  • How can I extract text from an existing Dialog Window? Its a 3rd party dialog window so I don't have the source code of it. I have to extract text from its Lables and Text box. I think for extracting text from TextBox we can use WM_COPYTEXT message (Not sure) But how can I extract text from labels of a dialog Window?


    Adeel


    If I am not wrong WM_COPYDATA is used to pass data to another application. What I am trying to achieve is reverse of WM_COPYDATE where I have to extract text data from Labels, TextBoxs, Radiobuttons, Checkboxes and other dialogBox Controls.

    Adeel

    Tuesday, May 15, 2012 5:00 AM
  • For static text (label), and Edit boxes, send WM_GETTEXT.  Do not use GetWindowText() since this does not work across different processes.
     
    This does not work with Common Controls, and messages such as LVM_GETITEMTEXT, which requires the caller to be within the same process.  For this, use SendMessageRemote instead:  http://www.ucosoft.com/get-clistctrl-item-text-of-another-process. html
     
    -- David
     

    Efficiently read and post to forums with newsreaders: http://communitybridge.codeplex.com
    • Marked as answer by maverick786us Tuesday, May 15, 2012 5:20 AM
    Tuesday, May 15, 2012 5:13 AM
  • For static text (label), and Edit boxes, send WM_GETTEXT.  Do not use GetWindowText() since this does not work across different processes.
    This does not work with Common Controls, and messages such as LVM_GETITEMTEXT, which requires the caller to be within the same process.  For this, use SendMessageRemote instead:  http://www.ucosoft.com/get-clistctrl-item-text-of-another-process. html
    -- David
     

    Efficiently read and post to forums with newsreaders: http://communitybridge.codeplex.com
    That link is not working. So just like TextBox we can find the Window for Static Text (Labels) and then send WM_GETTEXT Message?

    Adeel


    Tuesday, May 15, 2012 5:16 AM
  • I believe so.  Google SendMessageRemote, it’s on my site, dcsoft.com.
     
    -- David
     
    "maverick786us" wrote in message news:29d700f7-e7c3-4e76-a8ac-434a9fe4454b@communitybridge.codeplex.com...
    That link is not working. So just like TextBox we can find the Window for Static Text (Labels) and then send WM_GETTEXT Message?

    Efficiently read and post to forums with newsreaders: http://communitybridge.codeplex.com
    Tuesday, May 15, 2012 2:31 PM
  • Thanks. Just one last question.

    1) What is the purpose of redraw window in this scenerio? Is it necessary for the child window approach to work?
    2) Only a small number of windows return any text from WM_GETTEXT. Is there another way? Some technique that DOES repainting on the screen?


    Adeel

    Monday, May 21, 2012 6:56 AM