|
-
Oct 12th, 2000, 09:29 PM
#1
I created a help file with Microsoft Help Workshop that shipped with VB5.
I'm having difficulites appling it to my app.
How do I call my help file from a menu click? (i.e. I have a menu called
help, with a sub menu called topics) I'd like for the help file to pop up
when that is clicked.
-
Oct 12th, 2000, 10:30 PM
#2
Code:
Public Declare Function RunFile Lib "shell32.dll" _
Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal _
lpOperation As String, ByVal lpFile As String, ByVal _
lpParameters As String, ByVal lpDirectory As String, ByVal _
nShowCmd As Long) As Long
'Open Help File
RunFile Me.Hwnd, "open", "C:\Your\HelpFile\Path\And.Name", vbNull, "C:\Your\" _
"Help\File\Path\", 0
Also, you can use CommonDialogs. You will have to research that yourself.
-
Oct 13th, 2000, 02:20 AM
#3
Hi
Place a CommonDialog control on a form together with 2 commands, Command1(0) and Command1(1) and insert this code:
Command1(0) for opening index and command1(1) for opening contect in your help file
Private Sub Command1_Click(Index As Integer)
App.HelpFile = "YourHelpFile.hlp" ' F1 can open the help file
CommonDialog1.CancelError = True
On Error GoTo ErrHandler
' Set the HelpCommand Property
CommonDialog1.HelpCommand = cdlHelpForceFile
' Specify the Help file.
CommonDialog1.HelpFile = App.HelpFile
Select Case Index
Case 0
CommonDialog1.HelpCommand = &H101&
Case 1
CommonDialog1.HelpCommand = &H3&
End Select
' Display the Windows Help engine.
CommonDialog1.ShowHelp
Exit Sub
ErrHandler:
' User pressed Cancel button.
Exit Sub
End Sub
This should work
Jorgen
-
Oct 14th, 2000, 05:06 PM
#4
CommonDialog Control
What is a CommonDialog Control?
-
Oct 14th, 2000, 05:15 PM
#5
The CommonDialog control provides a standard set of dialog boxes for operations such as opening, saving, and printing files or selecting colors and fonts.
To use: Click Project > Components > Microsoft Common Dialog Control 6.0 (or whatever version you have)
-
Oct 15th, 2000, 07:36 AM
#6
Frenzied Member
I recommend the ShellExecute api, don't use a control if there's an easy way around!
Jop - validweb.nl
Alcohol doesn't solve any problems, but then again, neither does milk.
-
Oct 15th, 2000, 10:10 AM
#7
If you want to have the files opened with WinHelp, I recommend against ShellExecute because it will open the file with it's default App (people might have the *.hlp files associated with another App). Use standard Shell method instead.
Code:
Shell "WINHELP.EXE C:\MyHelpFile.hlp", 1
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|