Date: 02-16-2022
Return to Index
created by gbSnippets
'When the user presses F1, windows sends the WM_Help message
'If a menu is active when F1 is pressed, WM_HELP is sent to the
'window associated with the menu; otherwise, WM_HELP is sent to
'the window that has the keyboard focus. If no window has the
'keyboard focus, WM_HELP is sent to the currently active window.
'Primary Code:
CallBack Function DlgProc() As Long
Select Case CB.Msg
Case %WM_Help
'response goes here
End Select
End Function
'Compilable Example: (Jose Includes)
'this example opens the gbSnippets Help file when F1 is pressed
#Compiler PBWin 9, PBWin 10
#Compile EXE
#Dim All
%Unicode=1
#Include "Win32API.inc"
Global hDlg as Dword
%IDC_Button = 100
Function PBMain() As Long
Dialog New Pixels, 0, "Test Code",300,300,200,200, %WS_OverlappedWindow To hDlg
Dialog Show Modal hDlg Call DlgProc
End Function
CallBack Function DlgProc() As Long
Local tempFile As Asciiz * %Max_Path, iReturn as Long
Select Case CB.Msg
Case %WM_Help 'sent in response to pressing F1
tempFile = Exe.Path$ + "support_files\gbsnippets.chm"
iReturn = ShellExecute(hDlg, "Open", tempFile, $Nul, $Nul, %SW_ShowNormal) 'bring up Help file contents
End Select
End Function
'gbs_00038
'Date: 03-10-2012
http://www.garybeene.com/sw/gbsnippets.htm