Contents of the input field

Contents of the input field

Postby Natter » Tue Nov 12, 2019 6:16 am

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
Natter
 
Posts: 1120
Joined: Mon May 14, 2007 9:49 am

Re: Contents of the input field

Postby Antonio Linares » Wed Nov 13, 2019 5:47 am

Natter,

Do it this way:

MsgInfo( GetWindowText( hWnd ) )
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Contents of the input field

Postby Natter » Wed Nov 13, 2019 6:57 am

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()
Natter
 
Posts: 1120
Joined: Mon May 14, 2007 9:49 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: richard-service and 54 guests