共用方式為


CToolBar::GetItemID

This member function returns the command ID of the button or separator specified by nIndex.

UINT GetItemID(
   int nIndex 
) const;

Parameters

  • nIndex
    Index of the item whose ID is to be retrieved.

Return Value

The command ID of the button or separator specified by nIndex.

Remarks

Separators return ID_SEPARATOR.

Requirements

Header: afxext.h

See Also

Concepts

CToolBar Class

CToolBar Members

Hierarchy Chart

CToolBar::CommandToIndex

CControlBar::GetCount