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 Tech Support » Please teach it if you like Collapse All
Subject Author Date
tera t Sep 13, 2007 - 1:40 AM

Hello.

Please teach it if you like.
Prof-UIS is an irrelevant topic.

I cannot acquire minimization button size well.
In "SM_CXSIZE, SM_CYSIZE", numerical value of 18*18 returns.
http://www.yukai.jp/~ifreeta/20070912/image02.jpg

tera t Sep 13, 2007 - 10:57 PM

Hello

I can seem to cope in SM_CXSIZE ,SM_CYSIZE somehow.
Thank you.

Technical Support Sep 13, 2007 - 10:59 AM

If you need to create some custom buttons in the non-client area, you could get the size of buttons in the non-client area by using some paint manager’s API. But please note that in some cases the paint manager will simply overlap these buttons with the caption text. The better solution is to implement your paint manager class which implements the following virtual method:

      virtual void NcFrame_Paint(
            CDC & dc,
            const CExtCmdIcon * pIcon,
            __EXT_MFC_SAFE_LPCTSTR strCaption,
            UINT nDrawTextAlignFlags,
            const RECT & rcFrame,
            const RECT & rcClient,
            const RECT & rcIcon,
            const RECT & rcText,
            const RECT & rcHelp,
            const RECT & rcMinimize,
            const RECT & rcMaximizeRestore,
            const RECT & rcClose,
            bool bFrameActive,
            bool bFrameEnabled,
            bool bFrameMaximized,
            e_nc_button_state_t eStateButtonHelp,
            e_nc_button_state_t eStateButtonMinimize,
            e_nc_button_state_t eStateButtonMaximizeRestore,
            e_nc_button_state_t eStateButtonClose,
            const CWnd * pWnd,
            LPARAM lParam = 0L
            ) const;
Your virtual method should adjust the rcText.right value for reserving the space for your buttons, invoke parent class methods and paint your custom buttons over the caption painted by default.