Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

GetWindowText and an edit control in another application

78 views
Skip to first unread message

Daniel Grafe

unread,
Nov 8, 1999, 3:00:00 AM11/8/99
to
I want to rerieve the text of an edit control in another application. I do
have a handle to the edit control but "GetWindowText" doesn't work. It does
work if the edit control already has a text after creation. Text typed by
the user can't be retrieved with GetWindowText. Is there a possibility to
get the Text of the edit control?


Thank you....

Mike Byrns

unread,
Nov 8, 1999, 3:00:00 AM11/8/99
to
You must explicitly use SendMessage and WM_GETTEXT to do that across process
boubdaries. Only SendMessage does the behind-the-scenes marshalling
required.
--
Mike Byrns
MSB Consulting Services
mike....@technologist.com

"Daniel Grafe" <tu...@dografe.de> wrote in message
news:80740p$kvvs$1...@fu-berlin.de...

Chris Becke

unread,
Nov 8, 1999, 3:00:00 AM11/8/99
to
"Mike Byrns" wrote:
> You must explicitly use SendMessage and WM_GETTEXT to do that across
process
> boubdaries. Only SendMessage does the behind-the-scenes marshalling
> required.

Close but not quite - GetWindowText() will retrieve the text set for any
window in the system - but, for windows in other processes, it retrieves it
directly from the windows internal WND struct. The text in the WND struct is
set by CreateWindowEx, and changed by allowing DefWindowProc() to handle
WM_SETTEXT messages. Any window that overrides WM_SETTEXT (such as EDIT
controls) will thus defeat a cross-process GetWindowText call.

Chris
--

Mike Byrns

unread,
Nov 8, 1999, 3:00:00 AM11/8/99
to
Let let him decide if it works for him.

"Chris Becke" <chr...@mvps.org> wrote in message
news:38273004$0$71...@helios.is.co.za...

Daniel Grafe

unread,
Nov 9, 1999, 3:00:00 AM11/9/99
to
SendMessage and WM_GETTEXT works fine for me. Tank you for your help.....

0 new messages