How to read text from the screen?

I want to read a text shown in a static window. The problem is that the text is not shown as a title. So I guess the text is written directly to the screen.
Is it possible to read the text from the screen? How?

Thanks a lot!!!

Comments

  • : I want to read a text shown in a static window. The problem is that the text is not shown as a title. So I guess the text is written directly to the screen.
    : Is it possible to read the text from the screen? How?
    :
    : Thanks a lot!!!
    :
    If you want to read the text in a static control in a dialog, you can use GetDlgItem(hDlg, ID_ITEM) to retrieve an handle to the static control. Then use GetWindowText to get the text!

    nICO

    [hr]
    [italic]How beautiful, if sorrow had not made Sorrow more beautiful than Beauty itself.[/italic]
    JOHN KEATS


  • : : I want to read a text shown in a static window. The problem is that the text is not shown as a title. So I guess the text is written directly to the screen.
    : : Is it possible to read the text from the screen? How?
    : :
    : : Thanks a lot!!!
    : :
    : If you want to read the text in a static control in a dialog, you can use GetDlgItem(hDlg, ID_ITEM) to retrieve an handle to the static control. Then use GetWindowText to get the text!
    :
    : nICO
    :
    :
    Thanks for your answer nICO.
    But: GetWindowText returns the title of the static control. The control I need to read from has no title. The text is just written to the DC or whatever. I don't know much about this stuff, so i can't tell you how this is done by the prog.
    Is there any possibility to read the text from the screen? (I have the handle of the control and can find out anything else, but not the text...) :(

    Thoron
  • : But: GetWindowText returns the title of the static control. The control I need to read from has no title. The text is just written to the DC or whatever. I don't know much about this stuff, so i can't tell you how this is done by the prog.
    : Is there any possibility to read the text from the screen? (I have the handle of the control and can find out anything else, but not the text...) :(
    :
    Oh, in that case I think there's no way to retrieve that text. If it's written with TextOut or DrawText it's just a bunch of pixel drawn to that DC.

    nICO

    [hr]
    [italic]How beautiful, if sorrow had not made Sorrow more beautiful than Beauty itself.[/italic]
    JOHN KEATS


  • : : But: GetWindowText returns the title of the static control. The control I need to read from has no title. The text is just written to the DC or whatever. I don't know much about this stuff, so i can't tell you how this is done by the prog.
    : : Is there any possibility to read the text from the screen? (I have the handle of the control and can find out anything else, but not the text...) :(
    : :
    : Oh, in that case I think there's no way to retrieve that text. If it's written with TextOut or DrawText it's just a bunch of pixel drawn to that DC.
    :
    : nICO
    :
    :
    :
    Hi again nICO,
    I feared that this would be the answer. Thanks for your help anyway...

    Thoron


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories