Page 1 of 1

Contents of the input field

Posted: Tue Nov 12, 2019 6:16 am
by Natter
Hi,

On the window of someone else's application there is an input field (class Edit).
There is text in this field. I know the pointer of this field and want to get its contents

#DEFINE WM_GETTEXT 13

buf:=space(200)
SendMessage(hWn, WM_GETTEXT, 200, @buf)

As a result, I get an empty value. What am I wrong about ?

Windows 10, FWH 18.06

Re: Contents of the input field

Posted: Wed Nov 13, 2019 5:47 am
by Antonio Linares
Natter,

Do it this way:

MsgInfo( GetWindowText( hWnd ) )

Re: Contents of the input field

Posted: Wed Nov 13, 2019 6:57 am
by Natter
Since I need to get the text from someone else's application, the Getwindowtext(hWn) function will return an empty value.
I solved this problem using clipboard

SendMessage(hWn, EM_SETSEL, 0, -1)
SendMessage(hWn, WM_COPY, 0, 0)
buf:=oClp:GetText()