Share via


TB_COMMANDTOINDEX (Compact 2013)

3/28/2014

For a toolbar, this message retrieves the zero-based index for the button associated with the specified command identifier.

For a central menu, this message retrieves the zero-based index for the menu item associated with the specified command identifier.

Syntax

TB_COMMANDTOINDEX
    wParam = (WPARAM) idButton;
  lParam = 0;

Parameters

  • idButton
    Command identifier associated with the button.
  • lParam
    Not used.

Return Value

For a toolbar, returns the zero-based index for the button on success. A value of -1 indicates that the specified command identifier is invalid.

For a central menu, returns -1 as the index for the central menu button, or -2 on failure.

Requirements

Header

commctrl.h

See Also

Reference

Toolbar Controls Messages