Partager via


CWinAppEx::EnableUserTools

Enables the user to create custom menu commands that reduce keystrokes in your application. This method creates a CUserToolsManager object.

BOOL EnableUserTools(
   const UINT uiCmdToolsDummy,
   const UINT uiCmdFirst,
   const UINT uiCmdLast,
   CRuntimeClass* pToolRTC = RUNTIME_CLASS(CUserTool),
   UINT uArgMenuID = 0,
   UINT uInitDirMenuID = 0 
);

Parameters

  • [in] uiCmdToolsDummy
    An unsigned integer that the framework uses as a placeholder for the command ID of the user tools menu.

  • [in] uiCmdFirst
    The command ID for the first user tool command.

  • [in] uiCmdLast
    The command ID for the last user tool command.

  • [in] pToolRTC
    A class that the CUserToolsManager object uses to create new user tools.

  • [in] uArgMenuID
    The argument menu ID.

  • [in] uInitDirMenuID
    The menu ID for the initial tool directory.

Return Value

TRUE if the method creates and initializes a CUserToolsManager object; FALSE if the method fails or if a CUserToolsManager object already exists.

Remarks

When you enable user-defined tools, the framework automatically supports a dynamic menu that can be extended during customization. The framework associates each new item with an external command. The framework invokes these commands when the user selects the appropriate item from the Tools menu.

Every time the user adds a new item, the framework creates a new object. The class type for the new object is defined by pToolRTC. The pToolRTC class type must be derived from the CUserTool Class.

For more information about user tools and how to incorporate them into your application, see User-defined Tools.

Requirements

Header: afxwinappex.h

See Also

Reference

CWinAppEx Class

Hierarchy Chart

CUserToolsManager Class

CUserTool Class

Concepts

User-defined Tools