This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.
virtual void OnDrawRibbonGalleryBorder(
   CDC* pDC,
   CMFCRibbonGallery* pButton,
   CRect rectBorder
);
Parameters
[in] pDC
[in] pButton
[in] rectBorder
Requirements
Header: afxvisualmanager.h