Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Enabling HHelp For MDI Parent

Status
Not open for further replies.

CassandraR

Programmer
Aug 10, 2001
346
CA

Hi:

I have searched for an answer to a basic HTML Help problem, but to no avail. How does one get the F1 key to work with the MDI Parent form? I have no problems with the MDI Child forms -- they are working, but the Parent form does not invoke the help system.

Thanks,
Cassie
[3eyes]
 
Hi:

Well, I found the answer after searching many web sites on the Inet. Here's what I managed to piece together. If anyone has a better way, PLEASE LET US KNOW!

In a Global module

Add the following:
Code:
Private Declare Function HtmlHelp Lib "hhctrl.ocx" 
	Alias "HtmlHelpA" _
   	(ByVal hwndCaller As Long, _
	ByVal lpHelpFile As String, _
	ByVal wCommand As Long, _
	ByVal dwData As Long) _
	As Long

Private Const HH_DISPLAY_TOC = &H1
Private Const HH_DISPLAY_INDEX = &H2
Private Const HH_DISPLAY_SEARCH = &H3
Private Const HH_HELP_CONTEXT = &HF

MDIForm (Parent)

Under the menu Project | Properties, add the name of the help file to the box labelled Help File Name.

Using the Menu Editor, add a menu item (mnuHelpContent in this example) and then add the following code. The last entity in the parentheses (i.e. the 1000 below) is the ContextID number.

Code:
Private Sub mnuHelpContent_Click()
   Call HtmlHelp(Me.hWnd, App.HelpFile, HH_HELP_CONTEXT, 1000)
End Sub


MDI Child Form

Using the Menu Editor, add a menu item (mnuHelpContent in this example) and then add the following code. The last entity in the parentheses (i.e. the 1234 below) is the ContextID number.

Code:
Private Sub mnuHelpContent_Click()
   Call HtmlHelp(Me.hWnd, App.HelpFile, HH_HELP_CONTEXT, 1234)
End Sub

Now, I have to figure out how to close the help file.

Thanks for your time.

Cassie
[dazed]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top