Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - No client edge in CView
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

No client edge in CView

 Post Reply Post Reply
Author
Message
Andreas Bergmei View Drop Down
Newbie
Newbie
Avatar

Joined: 06 March 2006
Location: Germany
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote Andreas Bergmei Quote  Post ReplyReply Direct Link To This Post Topic: No client edge in CView
    Posted: 16 March 2006 at 7:44am
When I'm adding ModifyStyleEx(WS_EX_CLIENTEDGE,0, SWP_FRAMECHANGED); to my OnInitialUpdate (to remove the 3d view off my CView) the CXTPShortcutBar starts to resize wrong. How must one remove the ClientEdge for this to work?
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: 22 March 2006 at 2:34pm
One way to do this would be to override WM_NCPAINT and draw the border yourself instead of removing the window style, for example:

void CYourView::OnNcPaint() 

{
    CWindowDC dc(this);
    
    // convert to client coordinates
    CRect rWindow;
    GetWindowRect(&rWindow);
    ScreenToClient(rWindow);

    int iWidth = -rWindow.top;

    rWindow.OffsetRect(-rWindow.left, -rWindow.top);
    
    // draw 1px. border.
    dc.Draw3dRect(&rWindow, ::GetSysColor(COLOR_3DSHADOW),
        ::GetSysColor(COLOR_3DSHADOW));
    
    if (iWidth > 1)
    {
        rWindow.DeflateRect(1,1);
        dc.Draw3dRect(&rWindow, ::GetSysColor(COLOR_WINDOW),
             ::GetSysColor(COLOR_WINDOW));
    }
}


Regards,
Codejock Support
Back to Top
Andreas Bergmei View Drop Down
Newbie
Newbie
Avatar

Joined: 06 March 2006
Location: Germany
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote Andreas Bergmei Quote  Post ReplyReply Direct Link To This Post Posted: 24 May 2006 at 10:40am
Ok, let's put it another way.
What if I set NO window style on creation of my view (embedding ShortcutBar). Then I have the same problem.
Basicly my question is why the ShortcutBar resizes wrong (maximizing a window, initial creation of window), when I have no WS_EX_CLIENTEDGE defined? Does it need some specific messages to handle the resize right or what does this depend on?
Back to Top
Andreas Bergmei View Drop Down
Newbie
Newbie
Avatar

Joined: 06 March 2006
Location: Germany
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote Andreas Bergmei Quote  Post ReplyReply Direct Link To This Post Posted: 31 May 2006 at 7:18am
We were moving the ShortcutBar to full size in OnDraw. Seems like when disabling the border we get a wrong ClientSize in OnDraw (somehow).
We cleared the OnDraw and are now maximizing the ShortcutBar in OnInitialUpdate and OnSize only which seems to work just fine (and should be faster anyhow).
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.094 seconds.