Results 1 to 11 of 11

Thread: Html Help

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 1999
    Location
    Taipei
    Posts
    318

    Cool

    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?



  2. #2
    Fanatic Member Stevie's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    565

    Thumbs up

    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.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 1999
    Location
    Taipei
    Posts
    318
    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?


  4. #4
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    i don't really understand the code either

  5. #5
    Fanatic Member Stevie's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    565
    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.

  6. #6
    Hyperactive Member
    Join Date
    Feb 2000
    Location
    Sedgefield
    Posts
    337

    Smile

    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]

  7. #7
    Fanatic Member Stevie's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    565
    Judd - I always store away nice bits of code, if after I've checked them they work

    You've also just cleared a thing or two up for me. Cheers!

  8. #8
    Hyperactive Member
    Join Date
    Feb 2000
    Location
    Sedgefield
    Posts
    337
    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

  9. #9
    Fanatic Member Stevie's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    565
    Nothing as fancy as that for me mate.

    I have a directory full of text files, where I have just cut and pasted code from where ever to a text file and given it an appropriate name.

    When I have spare time I then just cut and paste it into a demo project to see if it works. If it does I keep it, if not it usually goes if it can't be fixed/understood.

    If it does work, and I think it's pretty likely I would use it a lot, I have a few modules I use to store generic stuff, so I plonk it into one of those.

    Needless to say your little HTML Help stuff is in one of my modules in my present project waiting to be used at the end when I come round to writing the help.

  10. #10
    Hyperactive Member
    Join Date
    Feb 2000
    Location
    Sedgefield
    Posts
    337

    Talking 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

  11. #11
    Fanatic Member Stevie's Avatar
    Join Date
    Mar 2000
    Location
    London, UK
    Posts
    565

    Thumbs up Excellent!!

    Just downloaded the IconSnatcher and CodeBank.

    Cheers. (Again!!)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width