#Window = 0
Enumeration Menu
	#Menu
	#PopupMenu
EndEnumeration
Enumeration Menu_items
	#mOpen
	#mCopy
	#mDummy1
	#mDummy2
EndEnumeration

If OpenWindow(#Window, 200, 200, 200, 100, "Press Ctrl+D")
	If CreateMenu(#Menu, WindowID(#Window))
		MenuTitle("File")
		MenuItem(#mOpen, "Open" + #TAB$ + "Ctrl+O")
	EndIf
	If CreatePopupMenu(#PopupMenu)
		MenuItem(#mCopy, "Copy" + #TAB$ + "Ctrl+Shift+C")
	EndIf
	AddKeyboardShortcut(#Window, #PB_Shortcut_Control | #PB_Shortcut_O, #mOpen)
	AddKeyboardShortcut(#Window, #PB_Shortcut_Control | #PB_Shortcut_Shift | #PB_Shortcut_C, #mCopy)
	AddKeyboardShortcut(#Window, #PB_Shortcut_Control | #PB_Shortcut_D, #mDummy1)
	AddKeyboardShortcut(#Window, #PB_Shortcut_Control | #PB_Shortcut_F, #mDummy2)
	Repeat
		Select WaitWindowEvent()
			Case #PB_Event_RightClick
				DisplayPopupMenu(#PopupMenu, WindowID(#Window))
			Case #PB_Event_Menu
				Select EventMenu()
					Case #mOpen : Debug "Open"
					Case #mCopy : Debug "Copy"
					Case #mDummy1 : Debug "Dummy1"
					Case #mDummy2 : Debug "Dummy2"
				EndSelect
			Case #PB_Event_CloseWindow
				CloseWindow(#Window)
				End
		EndSelect
	ForEver
EndIf