INFO: LB_GETCARETINDEX Returns 0 for Zero Entries in List Box

ID: Q97922

The information in this article applies to:

SUMMARY

To determine whether a multiple selection list box is empty or has no items to select, two messages are required. First, call LB_GETCOUNT to determine whether or not the list box is empty. If the list box is not empty, then use LB_GETCARETINDEX to determine the position of the caret.

If you want a list box to contain selections that remain after the focus goes elsewhere, Microsoft recommends using visible check marks next to the items in the list box. This method provides better visual feedback to the user than a selection bar.

Additional query words: listbox

Keywords          : kbCtrl kbListBox kbNTOS kbGrpUser kbWinOS 
Issue type        : kbinfo

Last Reviewed: December 26, 1998