|
-
Aug 28th, 2001, 08:41 AM
#1
Thread Starter
Lively Member
how do I specify a help file
I people...
I would like to know. I have a .HLP file (help file). I need it to open if the user press F1 or click on the 'Help' on the MENU.
How do I it? I just want to open it.... no helpindex etc.
thanks!
-
Aug 28th, 2001, 08:45 AM
#2
-= B u g S l a y e r =-
Sample for u Sundance Kid
VB Code:
Private 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
Private Const HELP_CONTENTS = &H3&
Private Const HELP_QUIT = &H2
Private Sub mnuHelp_Click()
WinHelp Me.hwnd, App.Path & "\HelpFile.hlp", HELP_CONTENTS, 0
End Sub
Private Sub Form_Unload(Cancel As Integer)
WinHelp Me.hwnd, "", HELP_QUIT, 0
End Sub
-
Aug 28th, 2001, 08:50 AM
#3
Thread Starter
Lively Member
Thanks peet
-
Aug 28th, 2001, 08:54 AM
#4
-= B u g S l a y e r =-
Your welcome 
You can also use shellexecute....
VB Code:
Option Explicit
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
(ByVal hwnd As Long, ByVal lpszOp As String, _
ByVal lpszFile As String, ByVal lpszParams As String, _
ByVal LpszDir As String, ByVal FsShowCmd As Long) _
As Long
Private Const SW_SHOWNORMAL = 1
Private Sub Command1_Click()
'Open a web page
Dim l As Long
l = ShellExecute(Me.hwnd, "Open", "http://www.vbworld.com", "", "C:\", SW_SHOWNORMAL)
End Sub
Private Sub Command2_Click()
'Open a document
Dim l As Long
l = ShellExecute(Me.hwnd, "Open", App.Path & "\Test.Doc", "", "C:\", SW_SHOWNORMAL)
End Sub
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
|