Solved

Changing MDI client color

Posted on 1998-01-08
2
263 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

762 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now