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!
Printable View
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!
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
Thanks peet :)
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