CWnd::OnCharToItem

Syntax

afx_msg int OnCharToItem( UINT nChar, CWnd* pListBox, UINT nIndex );

Parameters

nChar

Specifies the value of the key pressed by the user.

pListBox

Specifies a pointer to the list box. It may be temporary.

nIndex

Specifies the current caret position.

Remarks

A list box with the LBS_WANTKEYBOARDINPUT style sends its owner a WM_CHARTOITEM message in response to a WM_CHAR message. WM_CHARTOITEM is handled by default by OnCharToItem.

This message-handler member function calls the Default member function. Override this member function in your derived class to handle the WM_CHARTOITEM message.

Return Value

Specifies the action that the application performed in response to the call. A return value of -2 indicates that the application handled all aspects of selecting the item and wants no further action by the list box. A return value of -1 indicates that the list box will perform the default action in response to the keystroke. A return value of 0 or greater specifies the index of an item in the list box and indicates that the list box will perform the default action for the keystroke on the given item.

See Also

CWnd::Default, WM_CHAR, WM_CHARTOITEM