BCGControlBar Pro for MFC
CBCGPBaseRibbonElement* CBCGPRibbonBar::FindByID ( UINT  uiCmdID,
BOOL  bVisibleOnly = TRUE,
BOOL  bExcludeQAT = FALSE,
BOOL  bNonCustomOnly = TRUE,
BOOL  bCheckForSimplifiedMode = FALSE,
BOOL  bExcludePrintPreview = FALSE 
) const

Finds a ribbon element by its command ID.

Returns
A valid pointer to ribbon element with specified command ID, or NULL, if element with specified command ID does not exist, or element is not visible and bVisibleOnly flag is TRUE.

Use this method to find a (first) ribbon element by its command ID. In general, it can be more than one element with specified ID (for example, elements can be copied to Quick Access Toolbar). If you need to obtain pointers to all elements with specified ID use the GetElementsByID() method.

Parameters
uiCmdIDSpecifies the command ID to find by.
bVisibleOnlyIf TRUE, only the list of visible elements will be searched.
bExcludeQATIf TRUE, the QAT-located elements will be excluded from the search scope.
bNonCustomOnlyIf TRUE, the custom (created by user in the customization process) elements will be excluded from the search scope.
bCheckForSimplifiedModeIf TRUE, the elements invisible in the current mode (classic or simplified), will be excluded from the search scope.
bExcludePrintPreviewIf TRUE, the elements from the unternal "Print Preview" tab will be excluded from the search scope.