The RC Script I used:
Code: Select all
2001 MENU
BEGIN
POPUP "&File"
BEGIN
MENUITEM "New", 6001
MENUITEM "Open", 6002
MENUITEM SEPARATOR
MENUITEM "Exit", 6003
END
POPUP "&Edit"
BEGIN
MENUITEM "Undo", 6004
MENUITEM "Redo", 6005
MENUITEM SEPARATOR
MENUITEM "Cut", 6006
MENUITEM "Copy", 6007
MENUITEM "Paste", 6008
MENUITEM SEPARATOR
MENUITEM "Select All", 6009
END
POPUP "Help"
BEGIN
MENUITEM "About", 6010
END
END
The code:
Code: Select all
Import "menu.res" ;the compiled RC Script
EndImport
OpenWindow(0, 0, 0, 350, 200, "Resource Menu Test", #PB_Window_ScreenCentered | #PB_Window_SystemMenu)
hMenu = LoadMenu_(GetModuleHandle_(0), 2001) ;Load the menu...
SetMenu_(WindowID(0), hMenu) ;...and attach it to your window
;You can use the PB Event System to determine events
;Use the IDs from your script
Repeat
Event = WaitWindowEvent()
If Event = #PB_Event_Menu
Select EventMenu()
Case 6001
Debug "New"
Case 6002
Debug "Open"
Case 6003
End
Case 6004
Debug "Undo"
Case 6005
Debug "Redo"
Case 6006
Debug "Cut"
Case 6007
Debug "Copy"
Case 6008
Debug "Paste"
Case 6009
Debug "Select All"
Case 6010
Debug "About"
EndSelect
EndIf
Until Event = #PB_Event_CloseWindow
to create the templates.
Don't know if somebody finds this useful
