Click here to Skip to main content
15,881,173 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalwmi Pin
ozgul28-Feb-05 22:52
ozgul28-Feb-05 22:52 
GeneralRe: wmi Pin
Steve Thresher1-Mar-05 1:52
Steve Thresher1-Mar-05 1:52 
GeneralRe: wmi Pin
ozgul1-Mar-05 2:49
ozgul1-Mar-05 2:49 
GeneralRe: wmi Pin
Aamir Butt2-Mar-05 0:01
Aamir Butt2-Mar-05 0:01 
GeneralGetting a bit frustrated with Readfile/Writefile Pin
User 137680028-Feb-05 22:46
User 137680028-Feb-05 22:46 
GeneralRe: Getting a bit frustrated with Readfile/Writefile Pin
Michael Dunn1-Mar-05 1:42
sitebuilderMichael Dunn1-Mar-05 1:42 
GeneralRe: Getting a bit frustrated with Readfile/Writefile Pin
User 13768001-Mar-05 8:32
User 13768001-Mar-05 8:32 
GeneralChanging colours of a combo box (reposted) Pin
Alton Williams28-Feb-05 22:31
Alton Williams28-Feb-05 22:31 
Hi,

I've subclassed CComboBox. I've setup the background and text colours called Invalidate(). Which works perfectly well with the edit box. It's when I dropdown it's crashing the app. I want to able to change the colour of the listbox part as well.

Here's the code snippet:

<br />
BEGIN_MESSAGE_MAP(CComboEx, CComboBox)<br />
	//{{AFX_MSG_MAP(CComboEx)<br />
	ON_WM_CTLCOLOR_REFLECT()<br />
	ON_WM_CTLCOLOR()<br />
	//}}AFX_MSG_MAP<br />
END_MESSAGE_MAP()<br />
<br />
/////////////////////////////////////////////////////////////////////////////<br />
// CComboEx message handlers<br />
<br />
HBRUSH CComboEx::CtlColor(CDC* pDC, UINT nCtlColor) <br />
{<br />
	// TODO: Change any attributes of the DC here<br />
	<br />
/*	// TODO: Return a non-NULL brush if the parent's handler should not be called<br />
	if(nCtlColor = CTLCOLOR_LISTBOX)<br />
	{<br />
		return OnCtlColor(pDC,this,nCtlColor);<br />
	}<br />
*/	<br />
	pDC->SetTextColor(m_Text);<br />
	pDC->SetBkColor(m_Background);<br />
	pDC->SetBkMode(TRANSPARENT);<br />
	m_brush.DeleteObject();<br />
	m_brush.CreateSolidBrush(m_Background);<br />
	return m_brush;<br />
}<br />
<br />
HBRUSH CComboEx::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) <br />
{<br />
	HBRUSH hbr = CComboBox::OnCtlColor(pDC, pWnd, nCtlColor);<br />
	<br />
	return hbr;<br />
}<br />
<br />

Thanks in advance,
Alton
QuestionHow to get the full Path from GetDisplayName Pin
Lonely Byte28-Feb-05 22:08
Lonely Byte28-Feb-05 22:08 
AnswerRe: How to get the full Path from GetDisplayName Pin
Ravi Bhavnani1-Mar-05 4:32
professionalRavi Bhavnani1-Mar-05 4:32 
GeneralRe: How to get the full Path from GetDisplayName Pin
Lonely Byte1-Mar-05 19:40
Lonely Byte1-Mar-05 19:40 
QuestionHow to manipulate bitmap in a View? Pin
kokehqyu28-Feb-05 20:38
kokehqyu28-Feb-05 20:38 
AnswerRe: How to manipulate bitmap in a View? Pin
Selvam R28-Feb-05 22:29
professionalSelvam R28-Feb-05 22:29 
GeneralRe: How to manipulate bitmap in a View? Pin
kokehqyu1-Mar-05 13:50
kokehqyu1-Mar-05 13:50 
GeneralInitially visible dialog box Pin
Kapgan28-Feb-05 20:16
Kapgan28-Feb-05 20:16 
GeneralRe: Initially visible dialog box Pin
zhang80060528-Feb-05 20:47
zhang80060528-Feb-05 20:47 
GeneralRe: Initially visible dialog box Pin
Kapgan1-Mar-05 0:24
Kapgan1-Mar-05 0:24 
GeneralRe: Initially visible dialog box Pin
Ed K1-Mar-05 10:58
Ed K1-Mar-05 10:58 
GeneralUDP transfer Pin
Raghav SR28-Feb-05 19:21
Raghav SR28-Feb-05 19:21 
GeneralRe: UDP transfer Pin
Alexander M.,1-Mar-05 5:14
Alexander M.,1-Mar-05 5:14 
GeneralMedia Gateway's in VoIP Pin
Raghav SR28-Feb-05 19:18
Raghav SR28-Feb-05 19:18 
Generalon using SSL components Pin
ppp00128-Feb-05 15:58
ppp00128-Feb-05 15:58 
GeneralRe: on using SSL components Pin
valikac28-Feb-05 18:52
valikac28-Feb-05 18:52 
GeneralRe: on using SSL components Pin
Ed K2-Mar-05 4:53
Ed K2-Mar-05 4:53 
GeneralSkinning menus and undoc'd menu msgs Pin
Ron Waller28-Feb-05 11:58
Ron Waller28-Feb-05 11:58 

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.