zqw0117,我想问的问题其实是EM_getLine的使用,我在网上找到以下资料,其中‘Before sending the message, set the first word of this buffer to the size, in TCHARs, of the buffer.’对EM_getLine使用有影响,我不知怎么设置,请帮忙!<br>-----------------------------------------------------------------------<br>EM_GETLINE的古怪又是没先好好看MSDN的注释,浪费了半天时间。。。 <br>看来磨刀不误砍柴工真是没错啊。。 <br><br>SendMessage( <br> (HWND) hWnd, // handle to destination window <br> EM_GETLINE, // message to send <br> (WPARAM) wParam, // line number <br> (LPARAM) lParam // line buffer (LPCTSTR) <br>); <br><br><br>Parameters <br><br>wParam <br><br>Specifies the zero-based index of the line to retrieve from a multiline edit control. A value of zero specifies the topmost line. This parameter is ignored by a single-line edit control. <br><br>lParam <br><br>Pointer to the buffer that receives a copy of the line. [red]Before sending the message, set the first word of this buffer to the size, in TCHARs, of the buffer.[/red]<br> 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. <br>Return Values <br><br>The return value is the number of TCHARs copied. The return value is zero if the line number specified by the wParam parameter is greater than the number of lines in the edit control. <br>Remarks <br>Edit controls: [red]The copied line does not contain a terminating null character.[/red] <br>---------------------------------------------------------------------------