Newbie needs help running help file 
Author Message
 Newbie needs help running help file

I have created a help file (Help.hlp) and would appreciate it if
someone could tell me what the syntax is to make it run. Thanks in
advance. Newbie.



Wed, 04 Aug 1999 03:00:00 GMT  
 Newbie needs help running help file

Quote:

>I have created a help file (Help.hlp) and would appreciate it if
>someone could tell me what the syntax is to make it run. Thanks in
>advance. Newbie.

Yep -- this is for the 32bit VB4, it will differ a little if you're
useing the 16bit compiler.

In a global module, place the following in your declaration section:

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

'Then define some constants that may be helpful:

Global Const HELP_CONTEXT = &H1
Global Const HELP_QUIT = &H2
Global Const HELP_INDEX = &H3
Global Const HELP_HELPONHELP = &H4
Global Const HELP_SETINDEX = &H5
Global Const HELP_KEY = &H101
Global Const HELP_MULTIKEY = &H201

To call the above API fuction, select the control on your form that
will be used to activate help. I like a "Help" command button, but
this works for a menu choice, or a button array member, or any other
control you might wish to use.

In the Click Event for the control you choose, place the code:

        Dim RV as Long
        RV = WinHelp(frmMyForm.hWnd, "c:\helppath\helpfilename.hlp", _
                                                HELP_INDEX, _
                                        CLNG(0))
And that will bring up your help file.

Be sure and attach the following code to the control (button or menu)
that exits your application:

        Dim RV as Long
        Dim Dummy as String
        RV = WinHelp(frmMyForm.hWnd, dummy, HELP_QUIT, 0)

You have to do this because it is quite possible for your end user to
close your program while it's help file is still up and running!
That's because WinHelp.EXE is called be the user32.dll, and of course
it's a seperate program which you do not control.

The other Help Constants are also fun to use, but I'll leave it to you
to experiment with them.

Hope this helps, John



Wed, 11 Aug 1999 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Newbie needs help? Shell not running .EXEs

2. Newbie Needs Help Displaying Text File

3. Newbie: Needs help locating files on drive...

4. Newbie needs help locating files on drive...

5. newbie needs help parsing csv file

6. Newbie needs HELP - on incorporating large data file

7. Newbie: Simple file routine help needed.

8. Newbie needs help reading binary files

9. Newbie needs help with an open file

10. Newbie needs help with text file program

11. Newbie needing help badly!! Please help

12. HELP! Newbie needs help with SQL for VB3

 

 
Powered by phpBB® Forum Software