problem with GetWindowText

V

Viorel

I have done:
1)found needed form with FindWindow
2)found an EDIT with EnumChildWindows
3)took text with GetWindowText
And as result I got nothing.
What I have done wrong?
P.S. Spy does the same.
 
W

William DePalo [MVP VC++ ]

Viorel said:
1)found needed form with FindWindow
2)found an EDIT with EnumChildWindows
3)took text with GetWindowText
And as result I got nothing.
What I have done wrong?

You may have missed the last sentence in the description of the function.
:)

<quote>
The GetWindowText function copies the text of the specified window's title
bar (if it has one) into a buffer. If the specified window is a control, the
text of the control is copied. However, GetWindowText cannot retrieve the
text of a control in another application.
</quote>

So, where the sender and receiver are threads in different processes you
should send a WM_GETTEXT message (possibly after sending a WM_GETTEXTLENGTH
message) instead of calling the function.

Regards,
Will
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top