Re: Displaying a help file
I use to send "F1" from code using sendkeys when needed (ie: pressing a help button on my form). I do not use the commondialogbox. I associate the help file to my project (project,properties->help file name).
Special thanks to Lothar "the Great" Haensler. Come back soon, you Guru.
Re: Displaying a help file
Personnaly i use the WinHelp API:
'Declaration of WinHelp command constants
public Const HELP_CONTEXT = &H1 ' Display topic in ulTopic
public Const HELP_QUIT = &H2 ' Terminate help
public Const HELP_INDEX = &H3 ' Display index
public Const HELP_CONTENTS = &H3
public Const HELP_HELPONHELP = &H4 ' Display help on using help
public Const HELP_SETINDEX = &H5 ' set current Index for multi index help
public Const HELP_SETCONTENTS = &H5
public Const HELP_CONTEXTPOPUP = &H8
public Const HELP_FORCEFILE = &H9
public Const HELP_KEY = &H101 ' Display topic for keyword in offabData
public Const HELP_COMMAND = &H102
public Const HELP_PARTIALKEY = &H105
public Const HELP_MULTIKEY = &H201
public Const HELP_SETWINPOS = &H203
public Declare Function WinHelp Lib "user32" Alias "WinHelpA" (byval hwnd as Long, _
byval lpHelpFile as string, _
byval wCommand as Long, _
byval dwData as Long) as Long
WinHelp hwnd, HELPFILEPATH, HELP_CONTEXT, ID
I know you're looking for commondialog, but if you change your mind...
Re: Displaying a help file
I like your solution. At firts occurence, I will try.
Best regards,
Cesare Imperiali
Special thanks to Lothar "the Great" Haensler. Come back soon, you Guru.
Re: Displaying a help file
Thank you for your help. I had never heard of that; but I tried it and it worked...
Re: Displaying a help file
The CommonDialog.ShowHelp is really outdated. It was conceived before the current Html stuff was implemented and involves creation of .hlp and .cnt files using the Help Workshop editor and other miscellaneous programs that have fallen by the wayside since Windows 95 was obsoleted.
Better of using Html editors and the WinHelp stuff. It's much more flexible. Also uses more resources so you can support buying bigger and better hardware.
At any rate, if you have .hlp and .cnt files, here is how you would implement
private Sub Form_Load()
Dim stHelp
stHelp = App.Path & "\Envelope Help\Envelope help.hlp"
cdlCommon.HelpFile = stHelp
cdlCommon.HelpCommand = cdlHelpContents
cdlCommon.ShowHelp
End Sub
John G