Skip to content

Latest commit

 

History

History
89 lines (52 loc) · 2.05 KB

lb-getcursel.md

File metadata and controls

89 lines (52 loc) · 2.05 KB
title description ms.assetid keywords topic_type api_name api_location api_type ms.topic ms.date
LB_GETCURSEL message (Winuser.h)
Gets the index of the currently selected item, if any, in a single-selection list box.
39ab7f77-6c8e-45a4-aad4-47eba0a11a11
LB_GETCURSEL message Windows Controls
apiref
LB_GETCURSEL
Winuser.h
HeaderDef
reference
05/31/2018

LB_GETCURSEL message

Gets the index of the currently selected item, if any, in a single-selection list box.

Parameters

wParam

Not used; must be zero.

lParam

Not used; must be zero.

Return value

In a single-selection list box, the return value is the zero-based index of the currently selected item. If there is no selection, the return value is LB_ERR.

Remarks

To retrieve the indexes of the selected items in a multiple-selection list box, use the LB_GETSELITEMS message. To determine whether the item that has the focus rectangle in a multiple selection list box is selected, use the LB_GETSEL message.

If sent to a multiple-selection list box, LB_GETCURSEL returns the index of the item that has the focus rectangle. If no items are selected, it returns zero.

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

LB_GETCARETINDEX

LB_GETSEL

LB_GETSELITEMS

LB_SETCURSEL