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_Help = 700
%IDM_CHMFile = 701
Global hDlg, hMenu, hHelp As Dword
Function PBMain()
Dialog New Pixels, 0, "MRU Demo",300,300,200,100, %WS_OverlappedWindow To hDlg
CreateAppMenu
Dialog Show Modal hDlg Call DlgProc()
End Function
CallBack Function DlgProc() As Long
Select Case Cb.Msg
Case %WM_Command
Select Case Cb.Ctl
Case %IDM_CHMFile : OpenHelp
End Select
Case %WM_Help : OpenHelp
End Select
End Function
Sub CreateAppMenu
Menu New Bar To hMenu
Menu New PopUp To hHelp
Menu Add PopUp, hMenu, "Help", hHelp, %MF_Enabled
Menu Add String, hHelp, "My App Help", %IDM_CHMFile, %MF_Enabled
Menu Attach hMenu, hDlg
End Sub
Sub OpenHelp
Local tempFile As Asciiz * %Max_Path, iReturn As Long
tempFile = "gbsnippets.chm" 'bring up Help file contents
iReturn = ShellExecute(hDlg, "Open", tempFile, $Nul, $Nul, %SW_ShowNormal)
End Sub
'gbs_01041
'Date: 03-10-2012
http://www.garybeene.com/sw/gbsnippets.htm