CB_GETEDITSEL message

Gets the starting and ending character positions of the current selection in the edit control of a combo box.

Parameters

wParam

A pointer to a DWORD value that receives the starting position of the selection. This parameter can be NULL.

lParam

A pointer to a DWORD value that receives the ending position of the selection. This parameter can be NULL.

Return value

The return value is a zero-based DWORD value with the starting position of the selection in the LOWORD and with the ending position of the first character after the last selected character in the HIWORD.

Examples

The following code example shows two ways of retrieving the current selection range.

DWORD start, end;

// Get the range from [out] parameters.
// hwnd is the handle of the combo box control.
SendMessage(hwnd, CB_GETEDITSEL, (WPARAM)&start, (LPARAM)&end;

// Get the range from the return value.
DWORD range = SendMessage(hwnd, CB_GETEDITSEL, NULL, NULL);
start = LOWORD(range);
end = HIWORD(range);

Requirements

Requirement Value
Minimum supported client
Windows Vista [desktop apps only]
Minimum supported server
Windows Server 2003 [desktop apps only]
Header
Winuser.h (include Windows.h)

See also

Reference

CB_SETEDITSEL

Other Resources

HIWORD

LOWORD