problem with GetWindowText

  • Thread starter Thread starter Viorel
  • Start date Start date
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.
 
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
 
Back
Top