Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 428
  • Last Modified:

Calling a help file .chm from a menu

I am currently working on a project that requires HTML help.  I used the HTML Help workshop to create the help file.  I have inserted it into the project properties.   My question is two parts.  
First I can now press F1 and my help file opens but this only happens if I have a document or form opened in the main form of the MDI.  How can I get the help to open for the application if no document or child from is open.

Second question I wanted to open the help from a call to a menu Item on click.
App.HelpFile = App.Path & "\CMP_Comm_Help.chm"
I inserted the following code to designate the help file but am missing something to actually open it.  Can any one tell me what I am missing to open the helpfile.

I have seen refrences to OSWinHelp(Me.hwnd, App.HelpFile, 261, 0)
if this is the missing code could someone please define the parameters for this argument.  
Thank You
0
LBoorn
Asked:
LBoorn
1 Solution
 
hesCommented:
In this example the help menu item is called cmd_Chm

Private Sub cmdCHM_Click()

    'hh.exe is the view for compiled help (CHM) files
    Dim i As Long
    i = Shell("hh.exe " & App.HelpFile ,vbNormalFocus)
   
End Sub
0
 
egsemsemCommented:
Hi,

1) Add this in General decleration part:

'''''''''''''''
'--> HTML Help
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   ' Display string resource ID or text in a pop-up window.
Const HH_HELP_CONTEXT = &HF         ' Display mapped numeric value in  dwData.
Const HH_TP_HELP_CONTEXTMENU = &H10 ' Text pop-up help, similar to WinHelp's HELP_CONTEXTMENU.
Const HH_TP_HELP_WM_HELP = &H11     ' text pop-up help, similar to WinHelp's HELP_WM_HELP.
Const HH_CLOSE_ALL = &H12
Private Declare Function HtmlHelp Lib "hhctrl.ocx" Alias "HtmlHelpA" (ByVal hwndCaller As Long, ByVal pszFile As String, ByVal uCommand As Long, ByVal dwData As Long) As Long


2) To be able to run Help by clicking F1, You can add a help item called 'Help' and assign 'F1' as a shortcut for it. By this way, when the user presses F1, the Help menu item will be called, where it should contain the following code in its Click event:

hwndHelp = HtmlHelp(me.hWnd, App.HelpFile, HH_DISPLAY_TOPIC, 0)


I hope I have helped,

Osama
0
 
Richie_SimonettiIT OperationsCommented:
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
Chandramouli kArchitectCommented:
listening..
0
 
DanRollinsCommented:
Hi LBoorn,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept egsemsem's comment(s) as an answer.
    ***  Richie_Simonetti's links are broken

LBoorn, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 
Richie_SimonettiIT OperationsCommented:
Gee.
0
 
SpideyModCommented:
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now