|
#include "stdafx.h"
#include "DispDlg.h"
#include "resource.h"
BOOL CeDisplayDlg::OnInitDialog()
{
CeDialog::OnInitDialog();
HWND hwnd = GetDlgItem(IDC_COMBO1);
m_combo.Attach( hwnd );
return TRUE;
}
void CeDisplayDlg::OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct )
{
m_combo.MeasureItem(lpMeasureItemStruct);
}
void CeDisplayDlg::OnDrawItem( int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct )
{
m_combo.DrawItem(lpDrawItemStruct);
}
LRESULT CeDisplayDlg::OnMessage(UINT uMsg, WPARAM wParam, LPARAM lParam, bool& bHandled)
{
switch (uMsg)
{
case WM_MEASUREITEM:
{
UINT idCtl = (UINT) wParam; // control identifier
LPMEASUREITEMSTRUCT lpmis = (LPMEASUREITEMSTRUCT) lParam; // item-size information
_ASSERTE(IDC_COMBO1 == idCtl);
OnMeasureItem(idCtl, lpmis);
bHandled = true;
}
break;
case WM_DRAWITEM:
{
UINT idCtl = (UINT) wParam; // control identifier
LPDRAWITEMSTRUCT lpdis = (LPDRAWITEMSTRUCT) lParam; // item-drawing information
_ASSERTE(IDC_COMBO1 == idCtl);
OnDrawItem(idCtl, lpdis);
bHandled = true;
}
break;
}
return 0;
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.