WM_GETTEXTLENGTH
An
application sends a WM_GETTEXTLENGTH message to determine the length, in
characters, of the text associated with a window. The length does not include
the terminating null character.
WM_GETTEXTLENGTH
wParam = 0; // not used; must be zero
lParam = 0; // not used; must be zero
Parameters
This message
has no parameters.
Return Values
The return
value is the length, in characters, of the text.
Default Action
The DefWindowProc
Remarks
For an edit control,
the text to be copied is the content of the edit control. For a combo box, the
text is the content of the edit control (or static-text) portion of the combo
box. For a button, the text is the button name. For other windows, the text is
the window title. To determine the length of an item in a list box, an
application can use the LB_GETTEXTLEN message.
Under certain
conditions, the DefWindowProc
To obtain the
exact length of the text, use the WM_GETTEXT, LB_GETTEXT, or CB_GETLBTEXT
messages, or the GetWindowText function.
See Also