Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Changing MDI client color

Posted on 1998-01-08
2
Medium Priority
?
271 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
Ready to get certified? Check out some courses that help you prepare for third-party exams.
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.
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

609 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