I once had to access a CListBox in another app and now I find myself needing to access a CEdit in another app.

I have read the doc on msdn and it says I can send an EM_GETLINE to the HWND of the CEdit. But when I do I get nothing back.

Spy++ shows it receiving the EM_GETLINE message, and shows 0 characters returned.

msdn also says that sending a WM_GETTEXT will return the entire text of the CEdit, but this fails to return anything as well.

I know that my code is right, because it is the same as I use for the CListBox, just different messages being sent.

Are there any tricks to CEdits that make them ignore these messages?

Also, why doesn't this idea work?
((CEdit *)Wnd)->GetLine(0,Buff);

It compiles okay, but it asserts about it not being a window.