WM_GETTEXT

This message is used to copy the text that corresponds to a window. For edit controls and combo-box edit controls, the text to be copied is the content of the edit control. For button controls, the text is the button name. For lixt boxes, the text is the currently selected item. For other windows, the text is the window caption.

Parameter Description  

wParam Specifies the maximum number of bytes to be copied, including the null-terminating character.  
lParam Points to the buffer that is to receive the text.  

Return Value

The return value is the number of bytes copied. It is LB_ERR if no item is selected or CB_ERR if the combo box has no edit control.