Solved

Changing MDI client color

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

Accepted Solution

by:
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;
      GetClientRect(&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

say

      CBackGround m_background;

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

m_background.SubclassWindow(m_hWndMDIClient);

now you have a red background.
0
 
LVL 1

Expert Comment

by:hasmet
ID: 1313661
what happened to my points ?
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to match SAS datasets by multiple key variables and then rename and create new variables? 2 89
bigDiff challenge 17 105
no14 challenge 14 66
wordappend challenge 8 172
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 …
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

776 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