Print Page | Close Window

No client edge in CView

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=3792
Printed Date: 10 November 2025 at 3:41pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: No client edge in CView
Posted By: Andreas Bergmei
Subject: No client edge in CView
Date 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?



Replies:
Posted By: kstowell
Date 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


Posted By: Andreas Bergmei
Date 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?


Posted By: Andreas Bergmei
Date 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).



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net