Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Flat MDIClient edges
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Flat MDIClient edges

 Post Reply Post Reply
Author
Message
Lenz View Drop Down
Newbie
Newbie
Avatar

Joined: 03 September 2003
Location: South Africa
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote Lenz Quote  Post ReplyReply Direct Link To This Post Topic: Flat MDIClient edges
    Posted: 11 September 2003 at 10:01am

I'm using the XTreme Suite. Does anyone know how to create a MDI application so that the client edges are flat? Ive included an image of the area.



Edited by Lenz
Lenz
Back to Top
Sven View Drop Down
Senior Member
Senior Member


Joined: 21 August 2003
Location: Germany
Status: Offline
Points: 127
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sven Quote  Post ReplyReply Direct Link To This Post Posted: 11 September 2003 at 2:46pm
The link to your image is invalid.
Back to Top
kstowell View Drop Down
Admin Group
Admin Group


Joined: 25 January 2003
Location: MIchigan, USA
Status: Offline
Points: 496
Post Options Post Options   Thanks (0) Thanks(0)   Quote kstowell Quote  Post ReplyReply Direct Link To This Post Posted: 02 November 2003 at 11:01am

Hello,

Override the WindowProc virtual function for your view and add the following code:

LRESULT CSampleView::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
    switch (message)
   
{
   
case WM_NCPAINT:
       
{
          
CWindowDC dc(this);

          
CRect rc;
          
GetWindowRect(&rc);

          
int cx = rc.Width();
          
int cy = rc.Height();

          
const COLORREF clrFrame = GetXtremeColor(XPCOLOR_3DSHADOW);
          
dc.Draw3dRect(0, 0, cx, cy, clrFrame, clrFrame);

           return TRUE;
       
}

        case WM_NCCALCSIZE:
       
{
            
NCCALCSIZE_PARAMS FAR* lpncsp = (NCCALCSIZE_PARAMS FAR*)lParam;

           // adjust non-client area for border space
          
lpncsp->rgrc[0].left += 1;
          
lpncsp->rgrc[0].top += 1;
          
lpncsp->rgrc[0].right -= 1;
          
lpncsp->rgrc[0].bottom -= 1;

          
return TRUE;
       
}
    
}

    return CView::WindowProc(message, wParam, lParam);
}

Let me know if this helps.

Cheers,
Codejock Support



Edited by Administrator
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.156 seconds.