Article View: cn.bbs.comp.program
Article #1093VC FAQ(5)
From: �ϵ�
Date: Sun, 19 Apr 1998 00:00
Date: Sun, 19 Apr 1998 00:00
64 lines
2314 bytes
2314 bytes
2m������:m TMN (������)
2m�� ��:m RAD
2m�� ��:m VC FAQ(5)
2m����վ:m '3m�Ͻ�ɺ�m' (Wed Apr 8 08:13:51 1998) , 5mվ���ż�m
[������ҳ] [����������] [ȫ��������]
_____________________________________________________
How subclass the listbox portion of a combobox?
_____________________________________________________
The listbox portion of a combobox is of type COMBOLBOX ( notice the
'L').
Because the ComboLBox window is not a child of the ComboBox window, it is
not obvious how to subclass the COMBOLBOX control. Luckily, under the
Win32
API, Windows sends a message to the COMBOBOX ( notice no 'L') called
WM_CTLCOLORLISTBOX before the listbox is drawn. The lParam passed with this
message contains the handle of the listbox. For example:
LRESULT CFileUpdateCombo::OnCtlColorListBox(WPARAM wParam,
LPARAM lParam)
{
if ( ! m_bSubclassedListBox )
{
HWND hWnd = (HWND)lParam;
CWnd* pWnd = FromHandle(hWnd);
if ( pWnd && pWnd != this )
{
// m_ListBox is derived from CListBox
m_ListBox.SubclassWindow(hWnd );
m_ListBox.SetOwner(this);
m_bSubclassedListBox = TRUE;
}
}
return (LRESULT)GetStockObject(WHITE_BRUSH);
}
[������ҳ] [����������] [ȫ��������]
--
m;31m�� ��Դ:���Ͻ�ɺ� bbs.njupt.edu.cn��[FROM: pc05.info.njupt]m
--
[m[1;33m�� ��Դ:���ϴ�С�ٺ���Ϣ����վ bbs.nju.edu.cn��[FROM: a507yjh.nju.edu][m
Technical Details
Message-ID:
<3OAiT8$tH0@bbs.nju.edu.cn>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: fc86e,3b8d98f44026d284,start X-Google-Attributes: gidfc86e,public From: mendy.bbs@bbs.nju.edu.cn (�ϵ�) Subject: VC FAQ(5) Date: 1998/04/19 Message-ID: <3OAiT8$tH0@bbs.nju.edu.cn> X-Deja-AN: 345960009 X-Filename: Programming/M.893022584.A Organization: nju_bbs Newsgroups: cn.bbs.comp.program