Name
SetTrayMenu -- set tray or dock menu (V11.0)
Synopsis
SetTrayMenu(id)
Library
menu

Function
This function can be used to set the menu strip specified by id as a tray or dock menu. On Windows systems, the menu strip will be set as a tray menu and on macOS and AmigaOS 4 the menu strip will be set as a dock menu. The menu strip passed to SetTrayMenu() must have been created using either CreateMenu() or @MENU and it must only consist of a single strip. The title of the menu strip is ignored.

Note that on Windows your program can only have a tray menu if it also has a tray icon which is why you should call SetTrayIcon() before you call this function.

On AmigaOS 4 your program can only have a dock menu if it has an AmiDock icon so you must make sure to set RegisterApplication to True in the @OPTIONS preprocessor command and you must provide an app icon. See AmiDock information for details.

To remove the current tray or dock menu, pass the special value #NONE in the id parameter.

Inputs
id
identifier for the menu strip to set as a tray menu
Example
CreateMenu(1, {{"Unused", {
   {"About...", ID = "about"},
   {"Quit", ID = "quit"}
}}})
SetTrayMenu(1)
The code above defines and sets menu 1 as a tray menu.

Show TOC