; Create the popup menu by adding some items to it.
Menu, Tray, NoStandard ; Delete default menu.
Menu, Tray, Add, Item1, MenuHandler
Menu, Tray, Add, Item2, MenuHandler
Menu, Tray, Add ; Add a separator line.
; Create another menu destined to become a submenu of the above menu.
Menu, Submenu1, Add, Item1, MenuHandler
Menu, Submenu1, Add, Item2, MenuHandler
; Create a submenu in the first menu (a right-arrow indicator). When the user selects it, the second menu is displayed.
Menu, Tray, Add, My Submenu, :Submenu1
Menu, Tray, Add ; Add a separator line below the submenu.
Menu, Tray, Add, Item3, MenuHandler ; Add another menu item beneath the submenu...