Skip to main content

CreateTaskbarGroup

Description

Creates new custom task bar group for custom commands.

NOTE: Stability is experimental. Non-backward compatible changes or removal may occur in any future release. Use of this feature is not recommended for production environments.

NOTE: If multiple task bar groups are created for the same MenuLocation with the same orderPriority, their relative ordering is unspecified and may vary between runs, sessions or versions. Do not rely on a particular order for groups with equal priority — assign distinct orderPriority values to guarantee a deterministic ordering (lower values are shown first).

The CreateTaskbarGroup function allows developers to create custom taskbar groups dynamically. Custom commands (created using the CreateCustomCommand function) can then be added to these groups using the AddCustomCommandToMenu function.

Location parameter specifies where in the taskbar the new group will appear. It can be:
  • MenuLocation_TaskBar_First: places the group as the first (leftmost) item in the taskbar.
  • Any pre-defined taskbar location (e.g., MenuLocation_TaskBar_MainActions or MenuLocation_TaskBar_Assignments): places the new group next to the speficied location.
  • MenuLocation_TaskBar_Last: places the group as the last (rightmost) item in the taskbar.

The function returns a new location ID that can be used as MenuLocation parameter in the AddCustomCommandToMenu function.

Empty groups are not visible. A group will appear in the taskbar only after at least one command has been added to it.

To remove a custom group, use the RemoveTaskbarGroup function.

See Taskbar Commands sample for example code.

Syntax

// shellFrame points here into the IShellFrame interface
const result = await shellFrame.Commands.CreateTaskbarGroup(
name,
location,
orderPriority,
);

Parameters

NameOptionalityTypeDescription
nameRequiredstringName of the new task bar group.
locationRequiredMenuLocationThe taskbar location where the new group will be created. It can be one of
the MenuLocationTaskBar* values. MenuLocation_TaskBar_First and MenuLocation_TaskBar_Last are used to create
the group at the beginning or end of the taskbar. Other values place the group next to the corresponding
built-in command group. The recommended value is MenuLocation_TaskBar_Last to create the group at the end of the taskbar.
orderPriorityRequirednumberOrder priority of the new group. Lower priority groups are shown first.

Return type

TypeDescription
Promise < number >Id for the new task bar group.