Click here to Skip to main content
16,004,991 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralOk, thanks Pin
nelzanoide4-Feb-03 0:18
nelzanoide4-Feb-03 0:18 
GeneralCSingleLock / CCriticalSection ?!?! Pin
Anonymous3-Feb-03 22:28
Anonymous3-Feb-03 22:28 
GeneralRe: CSingleLock / CCriticalSection ?!?! Pin
Hesham Amin4-Feb-03 0:34
Hesham Amin4-Feb-03 0:34 
GeneralRe-use a Cformview derived class Pin
Woody Green3-Feb-03 20:31
Woody Green3-Feb-03 20:31 
GeneralTitle Bar, StatusBar and DialogBack Ground Color Pin
Anonymous3-Feb-03 20:28
Anonymous3-Feb-03 20:28 
GeneralRe: Title Bar, StatusBar and DialogBack Ground Color Pin
HENDRIK R3-Feb-03 21:25
HENDRIK R3-Feb-03 21:25 
GeneralRe: Title Bar, StatusBar and DialogBack Ground Color Pin
Anonymous4-Feb-03 2:31
Anonymous4-Feb-03 2:31 
GeneralRe: Title Bar, StatusBar and DialogBack Ground Color Pin
HENDRIK R4-Feb-03 2:39
HENDRIK R4-Feb-03 2:39 
OnCtlColor works for sure when used for dialogs. Here's an example:

HBRUSH CMyDialog::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) 
{
    switch (nCtlColor)
    {
        case CTLCOLOR_DLG:
        {
            CBrush*     back_brush;
            COLORREF    color;
            color = (COLORREF) GetSysColor(COLOR_BTNFACE);
            back_brush = new CBrush(color);
            return (HBRUSH) (back_brush->m_hObject);
        }
    }
    return(CDialog::OnCtlColor(pDC, pWnd, nCtlColor));
}


And a solution for OnEraseBackground could look similar to this:

BOOL CSampleView::OnEraseBkgnd(CDC* pDC)
{
    // Set brush to desired background color.
    CBrush backBrush(RGB(255, 128, 128));
    // Save old brush.
    CBrush* pOldBrush = pDC->SelectObject(&backBrush);
    CRect rect;
    pDC->GetClipBox(&rect);     // Erase the area needed.
    pDC->PatBlt(rect.left, rect.top, rect.Width(), 
    rect.Height(), PATCOPY);
    pDC->SelectObject(pOldBrush);
    return TRUE;
}

*both examples taken fom MSDN and slightly modified Smile | :)
GeneralRe: Title Bar, StatusBar and DialogBack Ground Color Pin
Anonymous4-Feb-03 5:23
Anonymous4-Feb-03 5:23 
Questioncharacter display window in a dialog??? Pin
MJ_Karas3-Feb-03 19:40
MJ_Karas3-Feb-03 19:40 
AnswerRe: character display window in a dialog??? Pin
xxhimanshu3-Feb-03 20:24
xxhimanshu3-Feb-03 20:24 
GeneralRe: character display window in a dialog??? Pin
MJ_Karas4-Feb-03 3:45
MJ_Karas4-Feb-03 3:45 
AnswerRe: character display window in a dialog??? Pin
KarstenK3-Feb-03 20:50
mveKarstenK3-Feb-03 20:50 
GeneralRe: character display window in a dialog??? Pin
MJ_Karas4-Feb-03 3:59
MJ_Karas4-Feb-03 3:59 
GeneralRe: character display window in a dialog??? Pin
KarstenK4-Feb-03 4:15
mveKarstenK4-Feb-03 4:15 
GeneralFile Access into IStream Pin
Todd Richardson3-Feb-03 18:58
Todd Richardson3-Feb-03 18:58 
GeneralRe: File Access into IStream Pin
Amit Dey30-Mar-03 9:03
Amit Dey30-Mar-03 9:03 
GeneralRe: File Access into IStream Pin
Todd Richardson30-Mar-03 15:49
Todd Richardson30-Mar-03 15:49 
GeneralRe: File Access into IStream Pin
Amit Dey31-Mar-03 1:28
Amit Dey31-Mar-03 1:28 
Generalchanging tilebar text Pin
trustno13-Feb-03 17:10
trustno13-Feb-03 17:10 
GeneralRe: changing tilebar text Pin
Michael Dunn3-Feb-03 17:14
sitebuilderMichael Dunn3-Feb-03 17:14 
GeneralRe: changing tilebar text Pin
trustno14-Feb-03 12:04
trustno14-Feb-03 12:04 
GeneralEditing Application Icons Pin
mattmattbobatt3-Feb-03 14:26
mattmattbobatt3-Feb-03 14:26 
GeneralRe: Editing Application Icons Pin
PJ Arends3-Feb-03 14:57
professionalPJ Arends3-Feb-03 14:57 
GeneralGetting the source code of a web page Pin
kdani3-Feb-03 13:03
kdani3-Feb-03 13:03 

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.