PRB: WM_CHARTOITEM Messages Not Received by Parent of List Box

ID: Q72552


The information in this article applies to:


SUMMARY

When keyboard input is sent to a list box that has the LBS_WANTKEYBOARDINPUT style bit set, its parent does not receive WM_CHARTOITEM messages; however, WM_VKEYTOITEM messages are received. This is because the list box has the LBS_HASSTRINGS style bit set.

This behavior is by design. Windows sets the LBS_HASSTRINGS style bit for all list boxes except owner-draw list boxes. An owner-draw list box can be created with this style bit turned on or off. For owner-draw list boxes, the state of the LBS_HASSTRINGS style bit determines which messages are sent. WM_CHARTOITEM messages and WM_VKEYTOITEM messages are mutually exclusive.

The documentation for WM_CHARTOITEM states:


   Only owner-draw list boxes that do not have the LBS_HASSTRINGS style can
   receive this message. 

Additional query words: listbox


Keywords          : kbCtrl kbListBox kbNTOS kbGrpUser kbWinOS 
Version           : 
Platform          : 
Issue type        : kbprb 

Last Reviewed: March 6, 1999