Click here to Skip to main content
15,918,485 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: nonblocking server and FD_WRITE Pin
Jörgen Sigvardsson12-Aug-03 22:16
Jörgen Sigvardsson12-Aug-03 22:16 
GeneralRe: nonblocking server and FD_WRITE Pin
Rickard Andersson2012-Aug-03 23:00
Rickard Andersson2012-Aug-03 23:00 
GeneralRe: nonblocking server and FD_WRITE Pin
Jörgen Sigvardsson12-Aug-03 23:02
Jörgen Sigvardsson12-Aug-03 23:02 
GeneralKeyBoard & Mouse hooking Pin
WzR11-Aug-03 20:27
WzR11-Aug-03 20:27 
GeneralRe: KeyBoard & Mouse hooking Pin
Rage11-Aug-03 21:19
professionalRage11-Aug-03 21:19 
GeneralMFC DLL Distribution Question Pin
John Clump11-Aug-03 19:34
John Clump11-Aug-03 19:34 
GeneralRe: MFC DLL Distribution Question Pin
HPSI11-Aug-03 20:02
HPSI11-Aug-03 20:02 
GeneralRe: MFC DLL Distribution Question Pin
David Crow12-Aug-03 4:27
David Crow12-Aug-03 4:27 
Generalviewing an MS-Access Report without MS-Access Pin
sagmam11-Aug-03 18:59
sagmam11-Aug-03 18:59 
GeneralRe: viewing an MS-Access Report without MS-Access Pin
wb11-Aug-03 19:16
wb11-Aug-03 19:16 
GeneralHelp to understand these codes! Pin
colormyiris11-Aug-03 18:32
colormyiris11-Aug-03 18:32 
GeneralRe: Help to understand these codes! Pin
ZoogieZork11-Aug-03 18:41
ZoogieZork11-Aug-03 18:41 
GeneralRe: Help to understand these codes! Pin
igor196011-Aug-03 18:42
igor196011-Aug-03 18:42 
GeneralSetting Master Volume Pin
NorthWoodsman11-Aug-03 17:48
NorthWoodsman11-Aug-03 17:48 
GeneralRe: Setting Master Volume Pin
David Crow12-Aug-03 5:03
David Crow12-Aug-03 5:03 
QuestionHow to convert a non-mfc multithreading vc++6.0 win32sdk program to a mfc one ? Pin
suninwater11-Aug-03 17:27
suninwater11-Aug-03 17:27 
AnswerRe: How to convert a non-mfc multithreading vc++6.0 win32sdk program to a mfc one ? Pin
pranavamhari11-Aug-03 17:43
pranavamhari11-Aug-03 17:43 
GeneralRe: How to convert a non-mfc multithreading vc++6.0 win32sdk program to a mfc one ? Pin
suninwater11-Aug-03 19:14
suninwater11-Aug-03 19:14 
GeneralRe: How to convert a non-mfc multithreading vc++6.0 win32sdk program to a mfc one ? Pin
igor196011-Aug-03 19:46
igor196011-Aug-03 19:46 
GeneralRe: How to convert a non-mfc multithreading vc++6.0 win32sdk program to a mfc one ? Pin
suninwater11-Aug-03 19:59
suninwater11-Aug-03 19:59 
GeneralRe: How to convert a non-mfc multithreading vc++6.0 win32sdk program to a mfc one ? Pin
igor196011-Aug-03 20:26
igor196011-Aug-03 20:26 
GeneralRe: How to convert a non-mfc multithreading vc++6.0 win32sdk program to a mfc one ? Pin
suninwater11-Aug-03 21:01
suninwater11-Aug-03 21:01 
GeneralRe: How to convert a non-mfc multithreading vc++6.0 win32sdk program to a mfc one ? Pin
Steve S11-Aug-03 21:59
Steve S11-Aug-03 21:59 
GeneralRe: How to convert a non-mfc multithreading vc++6.0 win32sdk program to a mfc one ? Pin
suninwater11-Aug-03 22:48
suninwater11-Aug-03 22:48 
QuestionOnCtrlColor - how do I set a button fore color? Pin
michael thomas11-Aug-03 16:01
michael thomas11-Aug-03 16:01 
Hi,

I'm about to spontaneously combust if I can't manage to set the color of one single little button in a dialog. It seems that with OnCtlColor() I can set the color of EVERYTHING EXCEPT my button's foreground. Please help me before I blow! Confused | :confused:

I know I am missing something probably very simple. Do I need to use OnDrawItem()?

Thank you for any suggestions. I am relatively new (1 year) to MFC so be kind and if possible detailed in your suggestions. Thank you so much.

Here's one of several bits of code I have tried :-

//CBrush is set within OnInitDialog()
m_brush.CreateSolidBrush(RGB(0,0,255)); // Blue brush
....

HBRUSH CTry_button_colorsDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);

//this works ok - my editbox ends up a nice blue color
if (nCtlColor == CTLCOLOR_EDIT || nCtlColor == CTLCOLOR_MSGBOX )
{
pDC->SelectObject(m_brush);
hbr = this->m_brush;
}

//THIS DOES NOT WORK
if (nCtlColor == CTLCOLOR_BTN)
{
hbr = this->m_brush;
pDC->SetBkColor(RGB(0,0,255));
}

//THIS DOESN'T WORK EITHER
if( pWnd->GetDlgCtrlID() == IDC_MYBUTTON)
{
pDC->SetBkColor(RGB(0,0,255));
pDC->SelectStockObject(WHITE_BRUSH);
}

return hbr;
}






Michael

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.