Click here to Skip to main content
15,902,492 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Is this the fastest way to access the RGB values of a Pixel ? Pin
inayathussaintoori24-Oct-10 2:01
inayathussaintoori24-Oct-10 2:01 
GeneralRe: Is this the fastest way to access the RGB values of a Pixel ? Pin
Sauro Viti24-Oct-10 2:32
professionalSauro Viti24-Oct-10 2:32 
AnswerRe: Is this the fastest way to access the RGB values of a Pixel ? Pin
Luc Pattyn24-Oct-10 2:44
sitebuilderLuc Pattyn24-Oct-10 2:44 
GeneralRe: Is this the fastest way to access the RGB values of a Pixel ? Pin
inayathussaintoori24-Oct-10 7:53
inayathussaintoori24-Oct-10 7:53 
AnswerRe: Is this the fastest way to access the RGB values of a Pixel ? Pin
Sauro Viti24-Oct-10 21:54
professionalSauro Viti24-Oct-10 21:54 
Questionreplacing the default list box with custom made list box Pin
emmmatty123-Oct-10 18:37
emmmatty123-Oct-10 18:37 
AnswerRe: replacing the default list box with custom made list box Pin
Garth J Lancaster23-Oct-10 18:52
professionalGarth J Lancaster23-Oct-10 18:52 
GeneralRe: replacing the default list box with custom made list box Pin
emmmatty123-Oct-10 22:56
emmmatty123-Oct-10 22:56 
Thanks for the link.

I was trying the approach described in the following link
How to subclass CListBox and CEdit inside of CComboBox

I have created an ownerdrawn combobox and subclassed CComboBox and overridded all required methods such as[OnDrawItem,MeasureItem,etc] and WM_CTLCOLOR. I can see the code hits the OnDrawItem,MeasureItem,etc but it is never coming to OnCtlColor.

Can someone help me by pointing out what i am doing wrong?

HBRUSH CComboBoxEx2::OnCtlColor(CDC *pDC,CWnd *pWnd,UINT nCtlColor)<br />
{<br />
    <br />
<br />
	if (nCtlColor == CTLCOLOR_EDIT)<br />
      {<br />
         <br />
        // if (m_edit.GetSafeHwnd() == NULL)<br />
          //  m_edit.SubclassWindow(pWnd->GetSafeHwnd());<br />
      }<br />
      else if (nCtlColor == CTLCOLOR_LISTBOX)<br />
      {<br />
         <br />
        // if (m_listbox.GetSafeHwnd() == NULL)<br />
           // m_listbox.SubclassWindow(pWnd->GetSafeHwnd());<br />
      }<br />
      HBRUSH hbr = CComboBox::OnCtlColor(pDC, pWnd, nCtlColor);<br />
      return hbr;<br />
<br />
}<br />
<br />
void CComboBoxEx2::DeleteItem(LPDELETEITEMSTRUCT lpDeleteItemStruct)<br />
{<br />
	<br />
}<br />
<br />
void CComboBoxEx2::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)<br />
{<br />
	//if(m_lstPopup)<br />
<br />
	<br />
	CComboBox::DrawItem(lpDrawItemStruct);<br />
}<br />
<br />
void CComboBoxEx2::MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct)<br />
{<br />
	<br />
	CComboBox::MeasureItem(lpMeasureItemStruct);<br />
}<br />
<br />
int CComboBoxEx2::CompareItem(LPCOMPAREITEMSTRUCT lpCompareItemStruct)<br />
{<br />
	<br />
	<br />
	return 0;<br />
}

QuestionChange background color of CComboBox [modified] Pin
mesajflaviu23-Oct-10 7:51
mesajflaviu23-Oct-10 7:51 
AnswerRe: Change background color of CComboBox Pin
Code-o-mat23-Oct-10 8:37
Code-o-mat23-Oct-10 8:37 
GeneralRe: Change background color of CComboBox Pin
mesajflaviu23-Oct-10 9:19
mesajflaviu23-Oct-10 9:19 
GeneralRe: Change background color of CComboBox Pin
Code-o-mat23-Oct-10 9:24
Code-o-mat23-Oct-10 9:24 
GeneralRe: Change background color of CComboBox Pin
mesajflaviu25-Oct-10 0:52
mesajflaviu25-Oct-10 0:52 
GeneralRe: Change background color of CComboBox Pin
Code-o-mat25-Oct-10 1:13
Code-o-mat25-Oct-10 1:13 
AnswerRe: Change background color of CComboBox Pin
Dennis Dykstra23-Oct-10 11:48
Dennis Dykstra23-Oct-10 11:48 
GeneralRe: Change background color of CComboBox Pin
mesajflaviu25-Oct-10 0:51
mesajflaviu25-Oct-10 0:51 
GeneralRe: Change background color of CComboBox [modified] Pin
Dennis Dykstra25-Oct-10 17:01
Dennis Dykstra25-Oct-10 17:01 
GeneralRe: Change background color of CComboBox Pin
mesajflaviu28-Oct-10 7:37
mesajflaviu28-Oct-10 7:37 
QuestionRegarding Addition of Items in Tree Control by Type. Pin
janaswamy uday23-Oct-10 6:48
janaswamy uday23-Oct-10 6:48 
AnswerRe: Regarding Addition of Items in Tree Control by Type. Pin
Code-o-mat23-Oct-10 7:28
Code-o-mat23-Oct-10 7:28 
GeneralRe: Regarding Addition of Items in Tree Control by Type. Pin
janaswamy uday23-Oct-10 8:54
janaswamy uday23-Oct-10 8:54 
GeneralRe: Regarding Addition of Items in Tree Control by Type. Pin
Chris Losinger23-Oct-10 18:56
professionalChris Losinger23-Oct-10 18:56 
GeneralRe: Regarding Addition of Items in Tree Control by Type. Pin
Richard MacCutchan23-Oct-10 21:40
mveRichard MacCutchan23-Oct-10 21:40 
GeneralRe: Regarding Addition of Items in Tree Control by Type. Pin
janaswamy uday24-Oct-10 5:07
janaswamy uday24-Oct-10 5:07 
QuestionMenu Enabling Pin
Anil Kumar.Arvapalli23-Oct-10 2:53
Anil Kumar.Arvapalli23-Oct-10 2:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.