CB_SETEDITSEL

CB_SETEDITSEL

wParam = 0; /* not used, must be zero */

lParam = MAKELPARAM((ichStart), (ichEnd); /* start and end pos */

An application sends a CB_SETEDITSEL message to select characters in the edit control of a combo box.

Parameters

ichStart

Value of the low-order word of lParam. Specifies the starting position. If this parameter is set to -1, the selection, if any, is removed.

ichEnd

Value of the high-order word of lParam. Specifies the ending position. If this parameter is set to -1, all text from the starting position to the last character in the edit control is selected.

Return Value

The return value is TRUE if the message is successful. It is CB_ERR if the message is sent to a combo box with the CBS_DROPDOWNLIST style.

Comments

The positions are zero based. To select the first character of the edit control, you specify a starting position of zero. The ending position is for the character just after the last character to select. For example, to select the first four characters of the edit control, you would use a starting position of 0 and an ending position of 4.

See Also

CB_GETEDITSEL