Click to See Complete Forum and Search --> : Displaying a help file


Crowmaster
April 13th, 2001, 01:13 AM
Can anyone tell me the proper way of displaying a help file using the common dialogue box showhelp method? I've tried it; but the help file does not display. I even set the HelpFile property. So far, I have only been able to display the help file by connecting it to the application through the project properties dialogue box, and then pressing F1.

Cimperiali
April 13th, 2001, 02:48 AM
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.

F.Mayis
April 13th, 2001, 05:11 AM
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...

Cimperiali
April 13th, 2001, 06:09 AM
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.

Crowmaster
April 13th, 2001, 04:42 PM
Thank you for your help. I had never heard of that; but I tried it and it worked...

John G Duffy
April 14th, 2001, 08:40 AM
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