关于CComboBox控件的下拉列表句柄的获取,该怎么解决
关于CComboBox控件的下拉列表句柄的获取
如果在CComboBox控件的小按钮上单击一下,会弹出一个下拉列表,但只有当鼠标移到这个下拉列表中时才能在WM_CTLCOLORLISTBOX消息下获取下拉列表框的句柄;此时想知道,如何在单击CComboBox控件按钮弹出下拉列表框时就在WM_CTLCOLORLISTBOX消息下获得下拉框的句柄(鼠标在移到这个下拉列表框之前)?请指教,谢谢
------解决方案--------------------
试试这个
如果在CComboBox控件的小按钮上单击一下,会弹出一个下拉列表,但只有当鼠标移到这个下拉列表中时才能在WM_CTLCOLORLISTBOX消息下获取下拉列表框的句柄;此时想知道,如何在单击CComboBox控件按钮弹出下拉列表框时就在WM_CTLCOLORLISTBOX消息下获得下拉框的句柄(鼠标在移到这个下拉列表框之前)?请指教,谢谢
控件
鼠标
------解决方案--------------------
试试这个
BOOL GetComboBoxInfo(
PCOMBOBOXINFO pcbi
) const;
Syntax
typedef struct tagCOMBOBOXINFO {
DWORD cbSize;
RECT rcItem;
RECT rcButton;
DWORD stateButton;
HWND hwndCombo;
HWND hwndItem;
HWND hwndList;
} COMBOBOXINFO, *PCOMBOBOXINFO, *LPCOMBOBOXINFO;
Members
cbSize
The size, in bytes, of the structure. The calling application must set this to sizeof(COMBOBOXINFO).
rcItem
A RECT structure that specifies the coordinates of the edit box.
rcButton
A RECT structure that specifies the coordinates of the button that contains the drop-down arrow.
stateButton
The combo box button state. This parameter can be one of the following values.
0
The button exists and is not pressed.
STATE_SYSTEM_INVISIBLE
There is no button.
STATE_SYSTEM_PRESSED
The button is pressed.
hwndCombo
A handle to the combo box.
hwndItem
A handle to the edit box.
hwndList
A handle to the drop-down list.