|
-
May 22nd, 2000, 04:02 PM
#1
Thread Starter
Hyperactive Member
In the old version of help, we need the help compiler and also specify the help context in the VB form.
I heard about there is html help.
Exactly what it is?
What I should do in my VB in order to call it?
Do I still need help compiler?
Do I just need create the html file and that's all?
Do anybody have any idea?
-
May 22nd, 2000, 04:57 PM
#2
Fanatic Member
You can download HTML Help Workshop from the Microsoft web site, which will enable you to create HTML Help files.
To access the help from your application, you need to declare the following API's.
Code:
Public Const HH_DISPLAY_TOPIC = &H0
Const HH_SET_WIN_TYPE = &H4
Const HH_GET_WIN_TYPE = &H5
Const HH_GET_WIN_HANDLE = &H6
Const HH_DISPLAY_TEXT_POPUP = &HE
Const HH_HELP_CONTEXT = &HF
Const HH_TP_HELP_CONTEXTMENU = &H10
Const HH_TP_WM_HELP_MENU = &H11
Declare Function HtmlHelp1 Lib "hhctrl.ocx" Alias "HtmlHelpA"
(ByVal hwndCaller As Long, _
ByVal pszFile As String,
ByVal uCommand As Long,
ByVal dwData As Long) As Long
Declare Function HtmlHelp2 Lib "hhctrl.ocx" Alias "HtmlHelpA"
(ByVal hwndCaller As Long, _
ByVal pszFile As String,
ByVal uCommand As Long,
ByVal dwData As String) As Long
You can then access the help files by the following :
Code:
retrn = HtmlHelp1(0, "C:\Temp\Help.chm", HH_DISPLAY_TOPIC, 0)
retrn = HtmlHelp2(0, "C:\Temp\Help.chm", HH_DISPLAY_TOPIC, "My_Help.htm")
Hope this helps.
-
May 22nd, 2000, 05:07 PM
#3
Thread Starter
Hyperactive Member
Stevie,
you wrote 'You can then access the help files by the following', does that means we have to call the help by codes when user press the F1 Key, instead of declare the topic, context etc in the the form, control's property page?
-
May 22nd, 2000, 05:11 PM
#4
Conquistador
i don't really understand the code either
-
May 22nd, 2000, 05:19 PM
#5
Fanatic Member
What I posted will enable you to display a help file, with contents and index etc. The code is not for context sensitive help. The help in the HTML Help Workshop should explain how to integrate context sensitive help. I can't explain much more as I've only just found out all this myself, and haven't got round to the context stuff yet in my project.
-
May 22nd, 2000, 06:36 PM
#6
Hyperactive Member
km,
Compiled html is a type of compression specifically for html and associated documents (css, gif, jpg, vbs, js etc.) You create a project using something like HTML Help Workshop from Microsoft or RoboHelp HTML from BlueSky. This contains all you help files and how the are (hyper)linked together. It can also have an index, table of contents and search facility (yes, you do need a compiler).
It depends on HH.exe and HHctrl.ocx (comes with the Workshop and IE 4 + 5). You can use Stevies declarations to open the compiled html (.chm) file at the default topic (htmlhelp1), or at a specified page (htmlhelp2).
In truth, you only need htmlhelp1, if you know the internal referencing syntax for the pszFile argument which goes like:
[Path]\[CHM File]::/[HTM File]#[HyperLink]>[Window Definition]
eg.
"C:\Temp\MyHelp.chm::/Index.htm#Item1>DefaultWindow"
The compiled file can contain a number of window definitions in which to display help, you can name them and choose them during the call, if you don't specify, the default definition is used.
If you want help from F1, the easiest way is to set the help menu shortcut to F1, and set the mnuHelp_Click event to run up you chm file. If you what 'context sensitive' help you could keypreview on you forms for F1 and open the help file at the appropriate section (obviously, this is not the same as clicking the '?' button type context sensitive help, although that type can be implemented).
Stevie - Nice to see a bit of code reuse You must have a nice snippet library somewhere huh? 
There are lots of other functions you can access with this declaration - check out the HTMLHelp API section of MSDN.

Dan
[Edited by Judd on 05-23-2000 at 07:52 AM]
-
May 22nd, 2000, 06:56 PM
#7
-
May 22nd, 2000, 07:10 PM
#8
Hyperactive Member
Originally posted by Stevie
Judd - I always store away nice bits of code, if after I've checked them they work
Me too...how do you store yours out of interest? I've got quite a nice utility called Codebank 2 by Alex Kaufman.
(minor gripes, the rich text edit box doesn't 'tab' and there are no automatic syntax colouring routines (but its a generic code store, not just for vb)
You've also just cleared a thing or two up for me. Cheers!
Glad I could help,

Dan
-
May 22nd, 2000, 07:21 PM
#9
-
May 22nd, 2000, 07:27 PM
#10
Hyperactive Member
Neat
Well just in case you want to look:
http://pages.infinit.net/kaufman/Index.htm
Some neat stuff there - I use the traylauncher, iconsnatcher, startupcleaner and codebank

Dan
-
May 22nd, 2000, 07:41 PM
#11
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
|