Okay, I tried it, and here's how it seemsk to work (you may have already figured it out):
The control messages are only sent for right-clicks on the widget, and for both right and left clicks on the widget's system tray icon. The type and code arguments seem to be as advertised.
As for your question about a custom right-click menu, here's an example:
Note: This one is set up to just handle the right click on the object, but you could use the same contents for the OnControl notification, as long as you made sure it was for the event you wanted.
Function Object_OnRButtonUp(x,y,dragged)
If Not dragged Then
Dim menu
Set menu = DesktopX.CreatePopupMenu
menu.AppendMenu 0, 1, "Options 1"
menu.AppendMenu 0, 2, "Options 2"
menu.AppendMenu 0, 99, "DesktopX"
Dim rtn
rtn = menu.TrackPopupMenu(0, System.CursorX, System.CursorY)
Select Case rtn
Case 1
'Do something
Case 2
'Do something else
End Select
Set menu = nothing
End If
If rtn <> 99 Then
Object_OnRButtonUp=True ' Here's where we return True so DesktopX won't respond further
End If
End Function
This is covered in the documentation under "Scriptable Popup Menus".