PRB: WM_CHARTOITEM Messages Not Received by Parent of List Box

ID: Q72552


The information in this article applies to:
  • Microsoft Win32 Software Development Kit (SDK)
  • Microsoft Windows Software Development Kit (SDK) versions 3.0, 3.1
  • Microsoft Windows 2000


SYMPTOMS

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.   
If a dialog box procedure handles this message, it should cast the desired return value to a BOOL and return the value directly. The DWL_MSGRESULT value set by the SetWindowLong function is ignored.

Additional query words: listbox

Keywords : kbCtrl kbListBox kbNTOS kbWinOS2000 kbSDKWin32 kbGrpUser kbWinOS
Version : WINDOWS:3.0,3.1
Platform : WINDOWS
Issue type : kbprb


Last Reviewed: February 3, 2000
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.