|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
how to open a .hlp file
Question 1:
I am using Following code on MDIform to show help Private Sub tbrToolBar_ButtonClick(ByVal Button As MSComctlLib.Button) Select Case Button.Key Case "WorldWideWeb": Call itmWebBrowser_Click Case "Help": SendKeys ("{F1}") End Select End Sub my App.helpfile is defined properly as App.HelpFile = App.Path & "\Help\anish01.hlp" if I press F1 key on screen other than Mdiform, it works fine. but If I press on Mdiform, Application freezes and I have to restart the Application. any suggestions??? (On other screen, Keypreview property is set to true. MDIform does not have this property) Question 2: Everytime. User presses Help icon, index screen in my help file shows up. How can I show content screen. is there any good link for "Help" ??? |
|
#2
|
|||
|
|||
|
Try executing the helpfile directly instead of using the sendkeys. Perhaps that will work.
Option Explicit Private Declare Function ShellExecute 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 Private Sub ShowHelp() Dim lngResult As Long lngResult = ShellExecute(Me.hwnd, "open", App.HelpFile, vbNullString, vbNullString, 1) End Sub |
|
#3
|
|||
|
|||
|
Error Checking
Add some error checking to boot:
Private Sub mnuContents_Click() Dim lngResult As Long If Len(App.HelpFile) < 20 Then MsgBox "Unable to display Help Contents. There is no Help associated with this project.", vbInformation, Me.Caption Else On Error Resume Next lngResult = ShellExecute(Me.hwnd, "open", App.HelpFile, vbNullString, vbNullString, 1) If Err Then MsgBox Err.Description End If End If End Sub |
|
#4
|
|||
|
|||
|
I feel it's good way that use shellexecute function to avoid freeze the application form..
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > how to open a .hlp file |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|