CCommandManager::GetCmdImage

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Returns the index of an image that is associated with a specified command ID.


int GetCmdImage(
    UINT uiCmd,
    BOOL bUserImage = FALSE
) const;

[in] uiCmd

The command ID of a control.

[in] bUserImage

TRUE if the image is user-defined; FALSE if the image is global.

The index of the image if the element is found; otherwise, -1.

The following example demonstrates how to get a reference to a CCommandManager object and use the GetCmdImage method in the CCommandManager class. This code snippet is part of the Explorer Sample: MFC Windows Explorer Application.


	// CMenu menuHistory
	CMFCToolBarMenuButton btnBack (ID_GO_BACK, menuHistory, 
					GetCmdMgr ()->GetCmdImage (ID_GO_BACK), _T("Back"));


Header: afxcommandmanager.h

Show: