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 » CExtNCW Collapse All
Subject Author Date
Jean-Yves Tremblay Sep 19, 2007 - 7:32 AM

Hi,

I have a class derived from CExtNCW < CFrameWnd >.
I would like to enable/disable the custom painting features of CExtNCW at runtime.

Is it a correct way to set m_bNcFrameImpl_IsEnabled to true or false ?

Thank you

David

Technical Support Sep 19, 2007 - 12:33 PM

Yes, that is correct. But after changing m_bNcFrameImpl_IsEnabled, you should re-compute the window’s non-client area. You can use CExtNcFrameImpl::NcFrameImpl_RecalcNcFrame() for that or the following code:

HWND hWnd = . . .
      ::SetWindowPos(
            hWnd, NULL, 0, 0, 0, 0,
            SWP_FRAMECHANGED
                  |SWP_NOACTIVATE
                  |SWP_NOZORDER
                  |SWP_NOOWNERZORDER
                  |SWP_NOMOVE
                  |SWP_NOSIZE
            );