Compartilhar via


CMFCToolBar::SetCommandUsageOptions

Specifies when rarely used commands do not appear in the menu of the application.

static BOOL SetCommandUsageOptions(
   UINT nStartCount,
   UINT nMinUsagePercentage=5 
);

Parameters

  • [in] nStartCount
    Specifies the number of times that commands must be executed before the framework shows only the basic and recently-used commands.

  • [in] nMinUsagePercentage
    The percentage of times that a command must be executed to be considered a recently-used command.

Return Value

FALSE if nMinUsagePercentage is equal to or larger than 100; otherwise TRUE.

Remarks

Call this method to customize the algorithm that the framework uses to determine how basic and recently used menu items appear. For more information about basic commands, see CMFCToolBar::AddBasicCommand.

This class uses the CMFCCmdUsageCount class to track the usage count of commands. For more information about this class, see CMFCCmdUsageCount Class.

Requirements

Header: afxtoolbar.h

See Also

Reference

CMFCToolBar Class

Hierarchy Chart

CMFCToolBar::AddBasicCommand

CMFCCmdUsageCount Class