Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » Resizing problem of a CExtNCW < CFrameWnd > when using any of the Office2007 themes Collapse All
Subject Author Date
Andrej Kasa Dec 1, 2006 - 4:52 PM

Hello,

I just upgraded today to a freshly new 262 freeware. I have a reguluar doc/view SDI app and all themed skins work fine (when resizing) in the main frame window. However, I create on a user request a separate new frame window - until now I was using regular CFrameWnd for that purpose. I migrated this today to CExtNCW < CFrameWnd > and it looks great in the new Office2007 themes (This frame window is a CExtNCW < CFrameWnd > and its child is a CView). The problem is that if I try to resize such frame window either vertically or horizontally in most cases the window does not resize even that I move the mouse and the mouse cursor changes to the regular resizing one. I just roll the mouse but nothing happens - window is not being resized. Is this a known bug? This problem occurs not always but in 70% of cases when I tried to resize such window. It happens as well if I change mentioned CView to a CExtWS <CView>. This problem only occurs in Office2007 themes - all the other themes do not experience this problem.

krompo

Andrej Kasa Dec 8, 2006 - 6:52 AM

Hi once again,

thank you for your assitance in finding the cause of my problem. I already found out (accidentaly) that the problem was with loading the cursor in my window class. I create my frame window/view based on a custom class that I create by AfxRegisterWndClass(). The problem was that to load the cursor in this function I used LoadCursor(IDC_ARROW) and not (as it should be) ::LoadCursor(0,IDC_ARROW) what was executed within the InitInstance() app method. The cursor by that call was not loaded at all (a failure) but I didn’t find that out since except of this problem everything else was working fine.

regards,
krompo

Andrej Kasa Dec 4, 2006 - 10:56 AM

sorry, I meant bottom line, not the corner.

Andrej Kasa Dec 4, 2006 - 10:52 AM

Hi,

I created a completely blank/new project only to simulate this problem - and the problem is there as well. In all the overriden methods I call the base class CExtNCW < CFrameWnd >. Please see it on your own and download this file (complete sources + release exe built):

http://kasa.chassco.net/BugProfUISResizing.zip

When you run the EXE 2 frame window will be created:
1) default SDI mainframe window (Office2007 theme) - no point of interest in this case
2) a second frame window (same theme - using regular CView)

second window is in the background so you have to alt-tab it (because it is in OnNew) - this is our window. Please try not to move both of them before you start playing with it. On my computer the problem usually occurs around the vertical black line that I painted in OnDraw of the view.

Try to resize the window vertically/at the bottom corner several times on different places (best to start around the mentioned line). In horizontal resizing I did not observe this phenomenon.

Please let me know if you were able to recreate it (since it is happening randomly and not always but in 70% of cases that I tried). If you change the theme to any other except of Office2007 this problem never occurs.

krompo

Technical Support Dec 6, 2006 - 8:59 AM

Thank you for the test project, but we have not find any Prof-UIS related bugs in it. Please add following changes to your test project:

1) Add ModifyStyle( 0, WS_CLIPCHILDREN ); somewhere at the end of CBigFrame::OnCreate().

2) Modify the CBigView::OnDraw() and CBigView::OnEraseBkgnd() methods in this way:

void CBigView::OnDraw(CDC* pDC)
{
CRect rcClient;
    GetClientRect(&rcClient);
    pDC->FillSolidRect( &rcClient, RGB(0,255,0) );
    pDC->MoveTo(120,0);
    pDC->LineTo(120,300);
}

BOOL CBigView::OnEraseBkgnd(CDC* pDC)
{
    pDC;
    return TRUE;
}
3) Add a message handler for WM_SETCURSOR:
BOOL CBigView::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
{
    pWnd;
    nHitTest;
    message;
    ::SetCursor( ::LoadCursor( NULL, IDC_ARROW ) );
    return TRUE;
}
This should allow you to get the resizing cursor only when you really resize the skinned frame window.

Technical Support Dec 4, 2006 - 2:26 AM

We believe the problem may relate only to one frame window in your project. Please make sure all the virtual functions in your frame window call the methods of CExtNCW < CFrameWnd > :: *** () rather than CFrameWnd :: *** (). If the problem persists, you can send us a project that demonstrates the problem so we can help you out.