• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 373
  • Last Modified:

Changing the size of a CMDIFrameWnd's border

Is it possible to change the size of a CMDIFrameWnd's border?  I have an MDI app and I want to paint some controls in along the left side (vertically) of the frame window.  Thus moving it's client area over to the right more.  

I only want to change the left side of the border, the other side can stay the same.

1 Solution
You may try something like that:

void CMainFrame::OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR* lpncsp)
CMDIFrameWnd::OnNcCalcSize(bCalcValidRects, lpncsp);
if (bCalcValidRects)
          lpncsp->rgrc[0].left += 32;

Also you have to rewrite OnNcPaint:

void CMainFrame::OnNcPaint()
...Draw your stuff here
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

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