Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The Menu parameter describes the menu to appear. Each field represents on menu item. Each item has three values. The first value is any unique key or value you want to use to refer to the item later. The second value is the text to appear. For example, you can have an item whose key is "1" and text is "Copy". Or, the key could be "COPY" instead of "1". Whatever you pass is fine, as it will simply be forwarded onto the OnContextMenuClick event so you know exactly what was clicked. The third value is a flag indicating whether or not the menu item is enabled. This is useful for showing all available options but keeping certain ones enabled only when necessary. You can omit the third value, in which case the menu item will be enabled.

...

Code Block
// Show a context menu with Paste disabled since the clipboard is empty
Menu = "" 
Menu<-1> = "CUT"    :@VM:"Cut"     :@VM:1
Menu<-1> = "COPY"   :@VM:"Copy"    :@VM:1
Menu<-1> = "PASTE"  :@VM:"Paste"   :@VM:0   ; // Disabled
Menu<-1> = ""                               ; // Separator 
Menu<-1> = "ZOOMIN" :@VM:"Zoom In" :@VM:1
Menu<-1> = "ZOOMOUT":@VM:"Zoom Out":@VM:1 

Send_Message(Ctrl, "OLE.ShowContextMenu", "10,10", Menu, "My Special Data")

See Also

OnContextMenuClick