ClassesClassesClassesClasses | | | | Operators

set_tray_icon_context_menuset_tray_icon_context_menuSetTrayIconContextMenuset_tray_icon_context_menuSetTrayIconContextMenuSetTrayIconContextMenu (Operator)

Name

set_tray_icon_context_menuset_tray_icon_context_menuSetTrayIconContextMenuset_tray_icon_context_menuSetTrayIconContextMenuSetTrayIconContextMenu — Sets a context menu for the tray icon.

Signature

set_tray_icon_context_menu( : : TrayIconHandle, MenuStructure : )

Herror set_tray_icon_context_menu(const Hlong TrayIconHandle, const char* MenuStructure)

Herror T_set_tray_icon_context_menu(const Htuple TrayIconHandle, const Htuple MenuStructure)

Herror set_tray_icon_context_menu(const HTuple& TrayIconHandle, const HTuple& MenuStructure)

void SetTrayIconContextMenu(const HTuple& TrayIconHandle, const HTuple& MenuStructure)

void HNotificationX.SetTrayIconContextMenu(
[in] VARIANT TrayIconHandle, [in] VARIANT MenuStructure)

static void HNotification.SetTrayIconContextMenu(HTuple trayIconHandle, HTuple menuStructure)

Description

set_tray_icon_context_menuset_tray_icon_context_menuSetTrayIconContextMenuset_tray_icon_context_menuSetTrayIconContextMenuSetTrayIconContextMenu sets a context menu for the tray icon.

The context menu for the tray icon is defined with the parameter MenuStructureMenuStructureMenuStructureMenuStructureMenuStructuremenuStructure. Every string entry in tuple MenuStructureMenuStructureMenuStructureMenuStructureMenuStructuremenuStructure leads to an entry in the context menu. Sub menus can be created with an indentation by two spaces, a separator is defined with the text '-'. Checks or explicitly non-checked entried are created with the prefixes '[x] ' and '[ ] '.

To receive the event that an entry in the context menu was selected, the tray icon must be created with a message queue in create_tray_iconcreate_tray_iconCreateTrayIconcreate_tray_iconCreateTrayIconCreateTrayIcon or create_tray_icon_imagecreate_tray_icon_imageCreateTrayIconImagecreate_tray_icon_imageCreateTrayIconImageCreateTrayIconImage. Messages can be taken from this message queue with the help of operator dequeue_messagedequeue_messageDequeueMessagedequeue_messageDequeueMessageDequeueMessage. Possible messages are listed in the description of create_tray_iconcreate_tray_iconCreateTrayIconcreate_tray_iconCreateTrayIconCreateTrayIcon.

Find more information about the Notification extension package in the introduction to this chapter.

Parallelization

Parameters

TrayIconHandleTrayIconHandleTrayIconHandleTrayIconHandleTrayIconHandletrayIconHandle (input_control)  integer HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

handle to the tray icon

MenuStructureMenuStructureMenuStructureMenuStructureMenuStructuremenuStructure (input_control)  string(-array) HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

context menu structure

Default value: ['entry1','entry2'] ["entry1","entry2"] ["entry1","entry2"] ["entry1","entry2"] ["entry1","entry2"] ["entry1","entry2"]

Example (HDevelop)

  create_message_queue (MessageQueueHandle)
  create_tray_icon ('tooltip', 'folderopen', MessageQueueHandle, TrayIconHandle1)
  MenuStructure := \
                   [ 'entry1' \
                    ,'  [ ] subentry1' \
                    ,'  [X] subentry2' \
                    ,'    subsubentry21' \
                    ,'entry2' \
                    ,'-' \
                    ,'-' \
                    ,'entry3' \
                    ,'-' \
                    ,'entry4' \
  ]
  set_tray_icon_context_menu (TrayIconHandle, MenuStructure)

Possible Predecessors

create_tray_iconcreate_tray_iconCreateTrayIconcreate_tray_iconCreateTrayIconCreateTrayIcon, create_tray_icon_imagecreate_tray_icon_imageCreateTrayIconImagecreate_tray_icon_imageCreateTrayIconImageCreateTrayIconImage

Module

Foundation


ClassesClassesClassesClasses | | | | Operators