Contents of the input field

Post Reply
Natter
Posts: 524
Joined: Mon May 14, 2007 9:49 am

Contents of the input field

Post 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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Contents of the input field

Post by Antonio Linares »

Natter,

Do it this way:

MsgInfo( GetWindowText( hWnd ) )
regards, saludos

Antonio Linares
www.fivetechsoft.com
Natter
Posts: 524
Joined: Mon May 14, 2007 9:49 am

Re: Contents of the input field

Post 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()
Post Reply