Changing MDI client color

Posted on 1998-01-08
Last Modified: 2013-11-20
How to change the client area color of MDIFrameWnd window when creating it.
Question by:eugene_n
  • 2

Accepted Solution

hasmet earned 0 total points
ID: 1313660
Create new CWnd base class  CBackGround

handle WM_ERASEBKGND as below in your new class.

BOOL CBackGround::OnEraseBkgnd(CDC* pDC)
      BOOL result;
      result = CWnd::OnEraseBkgnd(pDC);
      RECT inside;
      pDC->FillSolidRect(&inside, 0x000000FF); // red background
      return result;

in your mainframe.h file include the header for the new class
and create a protected member


      CBackGround m_background;

Subclass this client window in your mainframe's OnCreate function as


now you have a red background.

Expert Comment

ID: 1313661
what happened to my points ?

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Host to IP 7 80
unable to delete all specified values regedit 38 539
My project did see openJDK that I installed. What could be the problem 7 151
Increment column based of a FK 8 31
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question