Click here to Skip to main content
15,908,841 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: why is ::CreatePen() failing? Pin
moredip20-Mar-02 11:32
moredip20-Mar-02 11:32 
GeneralRe: why is ::CreatePen() failing? Pin
alex.barylski20-Mar-02 14:28
alex.barylski20-Mar-02 14:28 
Generaltesting #define with no token string Pin
20-Mar-02 10:56
suss20-Mar-02 10:56 
GeneralRe: testing #define with no token string Pin
Joaquín M López Muñoz20-Mar-02 11:03
Joaquín M López Muñoz20-Mar-02 11:03 
Generalthe background color of CView Pin
20-Mar-02 10:19
suss20-Mar-02 10:19 
GeneralRe: the background color of CView Pin
Mazdak20-Mar-02 10:29
Mazdak20-Mar-02 10:29 
Generalan others solutions please Pin
20-Mar-02 10:43
suss20-Mar-02 10:43 
GeneralRe: an others solutions please Pin
Paul M Watt20-Mar-02 12:21
mentorPaul M Watt20-Mar-02 12:21 
I don't quite understand your point for not wanting to do it this way. Here is more information for WM_ERASEBKGND.

WM_ERASEBKGND is called when you call ::BeginPaint or use the CPaintDC inside of your WM_PAINT handler. If you try to do this in the WM_PAINT handler or somewhere else, you will get a flicker from the default handler for WM_ERASEBKGND erasing the background to white.

The wParam in WM_ERASEBKGND is the HDC that you should use to erase the background. This HDC is pre-initialized with the update region for the window, so it will clip anything automatically for you. Use this code:

COLORREF clr = RGB(255,0,255);

HBRUSH br = ::CreateSolidBrush(clr);

RECT rClient;
::GetClientRect(hWnd, &rClient);

::FillRect((HDC)wParam, &rClient, br);

::DeleteObject(br);

GeneralThe solution is Pin
20-Mar-02 21:24
suss20-Mar-02 21:24 
QuestionColors: How To? Pin
soup20-Mar-02 9:38
soup20-Mar-02 9:38 
AnswerRe: Colors: How To? Pin
Christian Graus20-Mar-02 9:49
protectorChristian Graus20-Mar-02 9:49 
GeneralRe: Colors: How To? Pin
soup20-Mar-02 13:11
soup20-Mar-02 13:11 
AnswerRe: Colors: How To? Pin
soup20-Mar-02 13:36
soup20-Mar-02 13:36 
GeneralRe: Colors: How To? Pin
Christian Graus20-Mar-02 14:35
protectorChristian Graus20-Mar-02 14:35 
AnswerRe: Colors: How To? Pin
Michael Martin20-Mar-02 15:30
professionalMichael Martin20-Mar-02 15:30 
AnswerRe: Colors: How To? Pin
soup21-Mar-02 11:37
soup21-Mar-02 11:37 
GeneralProperty Sheets and MMC Pin
Le centriste20-Mar-02 9:35
Le centriste20-Mar-02 9:35 
GeneralRe: Property Sheets and MMC Pin
Joaquín M López Muñoz20-Mar-02 10:59
Joaquín M López Muñoz20-Mar-02 10:59 
GeneralWord 2000 & Messages Pin
20-Mar-02 9:34
suss20-Mar-02 9:34 
GeneralRe: Word 2000 & Messages Pin
Mazdak20-Mar-02 9:38
Mazdak20-Mar-02 9:38 
QuestionHow can I change docking window properties? Pin
Craig Miller20-Mar-02 9:07
Craig Miller20-Mar-02 9:07 
AnswerRe: How can I change docking window properties? Pin
Bill Wilson20-Mar-02 12:09
Bill Wilson20-Mar-02 12:09 
GeneralRe: How can I change docking window properties? Pin
Craig Miller20-Mar-02 12:15
Craig Miller20-Mar-02 12:15 
GeneralRe: How can I change docking window properties? Pin
Bill Wilson20-Mar-02 13:30
Bill Wilson20-Mar-02 13:30 
GeneralRe: How can I change docking window properties? Pin
Bill Wilson20-Mar-02 13:32
Bill Wilson20-Mar-02 13:32 

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.