Date: 02-16-2022
Return to Index
created by gbSnippets
'Compilable Example: (Jose Includes)
#Compiler PBWin 9, PBWin 10
#Compile EXE
#Dim All
%Unicode=1
#Include "Win32api.inc"
%IDM_Open = 500
%IDM_Save = 600
%IDM_Help = 700
Global hDlg, hMenu, hFile As Dword
Function PBMain()
Dialog New Pixels, 0, "MRU Demo",300,300,300,200, %WS_OverlappedWindow To hDlg
CreateAppMenu
Dialog Show Modal hDlg Call DlgProc()
End Function
CallBack Function DlgProc() As Long
Select Case Cb.Msg
Case %WM_InitDialog
Case %WM_Command
Select Case Cb.Ctl
Case %IDM_Open : ? "Open"
Case %IDM_Save : ? "Save"
Case %IDM_Help : ? "Help"
End Select
End Select
End Function
Sub CreateAppMenu
Menu New Bar To hMenu
Menu New PopUp To hFile
Menu Add PopUp, hMenu, "&File", hFile, %MF_Enabled
Menu Add String, hFile, "&Open", 500, %MF_Enabled
Menu Add String, hFile, "&Save", 501, %MF_Enabled
AppendMenu hMenu, %MF_String Or %MF_RightJustify, %IDM_Help, "Help"
Menu Attach hMenu, hDlg
End Sub
'gbs_01000
'Date: 03-10-2012
http://www.garybeene.com/sw/gbsnippets.htm