Share via


CMFCVisualManager::OnDrawCaptionButton

The framework calls this method when it draws a CMFCCaptionButton object.

virtual void OnDrawCaptionButton (
   CDC* pDC,
   CMFCCaptionButton* pButton,
   BOOL bActive,
   BOOL bHorz,
   BOOL bMaximized,
   BOOL bDisabled,
   int nImageID = -1
);

Parameters

  • [in] pDC
    A pointer to a device context.

  • [in] pButton
    A pointer to a CMFCCaptionButton object. The framework draws this caption button.

  • [in] bActive
    A Boolean parameter that specifies whether the button is active.

  • [in] bHorz
    A Boolean parameter that specifies whether the caption is horizontal.

  • [in] bMaximized
    A Boolean parameter that specifies whether the parent pane is maximized.

  • [in] bDisabled
    A Boolean parameter that specifies whether the caption button is disabled.

  • [in] nImageID
    The image index for the icon to use for the button. If nImageID is -1, this method uses the image index recorded in pButton.

Remarks

The default implementation of this method displays a small button from the global instance of the CMenuImages class. The buttons are listed in the header file for CMenuImages. Some examples include CMenuImages::IdClose, CMenuImages::IdArowLeft, CMenuImages::IdArowRight, CMenuImages::IdArowDown, CMenuImages::IdArowUp, and CMenuImages::IdPinHorz.

Override this method in a derived class to customize the appearance of caption buttons.

Requirements

Header: afxvisualmanager.h

See Also

Reference

CMFCVisualManager Class

Hierarchy Chart

CMFCCaptionButton Class