Date: 02-16-2022
Return to Index
created by gbSnippets
'When the user presses F1, the %WM_HELP message is sent to the dialog. The typical
'response is to open a Help file (.hlp or .chm).
'Primary Code:
Case %WM_Help
If CB.Ctlmsg = %BN_Clicked Then 'open application Help file
Local tempFile As Asciiz * %Max_Path, iReturn as Long
tempFile = Exe.Path$ + "gbsnippets.chm" 'bring up Help file contents
iReturn = ShellExecute(hDlg, "Open", tempFile, $Nul, $Nul, %SW_ShowNormal)
End If
'Compilable Example: (Jose Includes)
'This simply opens a *.chm Help file when the user presses F1.
#Compiler PBWin 9, PBWin 10
#Compile EXE
#Include "Win32API.inc"
Global hDlg as Dword
Function PBMain() As Long
Dialog New Pixels, 0, "Test Code",300,300,200,200, %WS_OverlappedWindow To hDlg
Control Add Button, hDlg, 100,"Push", 50,10,100,20
Dialog Show Modal hDlg Call DlgProc
End Function
CallBack Function DlgProc() As Long
If CB.Msg = %WM_Help Then
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 If
End Function
'gbs_00192
'Date: 03-10-2012
http://www.garybeene.com/sw/gbsnippets.htm