Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 272
  • Last Modified:

Changing MDI client color

How to change the client area color of MDIFrameWnd window when creating it.
0
eugene_n
Asked:
eugene_n
  • 2
1 Solution
 
hasmetCommented:
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
 
hasmetCommented:
what happened to my points ?
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now