G
Guest
I need to extract text from a single-line edit control using this:
SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_GETLINE, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) (LPCTSTR) lParam;
);
where lParam is a buffer for text.
The docs say:
"Before sending the message, set the first word of this buffer to the size,
in TCHARs, of the buffer. For ANSI text, this is the number of bytes; for
Unicode text, this is the number of characters. The size in the first word
is overwritten by the copied line."
How to do that if the buffer is:
TCHAR[200] buffer;
SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) EM_GETLINE, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) (LPCTSTR) lParam;
);
where lParam is a buffer for text.
The docs say:
"Before sending the message, set the first word of this buffer to the size,
in TCHARs, of the buffer. For ANSI text, this is the number of bytes; for
Unicode text, this is the number of characters. The size in the first word
is overwritten by the copied line."
How to do that if the buffer is:
TCHAR[200] buffer;