|
-
Sep 13th, 2000, 01:45 PM
#1
Thread Starter
Lively Member
Howdi..
I have put the path to the help-file in the "Project properties and if I press "F1" the HTML Help show's the help-file.
THE QUESTION:
How do I show the help-file from a menu. I tryed to use "SendKey ({F1})" and it works if the program is active but since I have a a icon in the tray icon bar where a menu is shown on right-click it's not sure that the program is active and I send the F1 key to something else.
Any ideá?
-
Sep 13th, 2000, 02:19 PM
#2
Private Sub OpenHelp(file As String)
Dim lngResult As Long
lngResult = ShellExecute(frm1.hwnd, "Open", file, "", "", vbNormalFocus)
End Sub
Invoke this as
Call OpenHelp(strhelp)
in mnuHelp_click()
-
Sep 13th, 2000, 02:36 PM
#3
Or you can use the Shell method.
Code:
Shell "hh.exe MyCHTM.chm", 1
-
Sep 13th, 2000, 02:40 PM
#4
When I used the Shell method, on some client machines, even though the task manager showed the Help file, i could not access it by any method and my application always had focus .
Any ideas why?
-
Sep 13th, 2000, 02:58 PM
#5
Thread Starter
Lively Member
Sub or Function not defined is the only thing I get if I use sarun's example..
Is there anything missing in the code?
-
Sep 13th, 2000, 03:08 PM
#6
Where is the sub defined(in a module?)
Note that it is declared as Private
-
Sep 13th, 2000, 03:24 PM
#7
Fanatic Member
You must declare the API:
Code:
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 OpenHelp(file As String)
Dim lngResult As Long
lngResult = ShellExecute(frm1.hwnd, "Open", file, "", "", vbNormalFocus)
End Sub
'Invoke this as
Call OpenHelp(strhelp)
GWDASH
[b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]
-
Sep 13th, 2000, 03:26 PM
#8
Oops! Sorry I forgot to mention that.
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
|