Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Calling a help file .chm from a menu

Posted on 2002-04-10
7
Medium Priority
?
424 Views
Last Modified: 2008-02-01
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
Comment
Question by:LBoorn
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 20

Expert Comment

by:hes
ID: 6932013
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
 
LVL 2

Accepted Solution

by:
egsemsem earned 400 total points
ID: 6932442
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
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 6932485
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 5

Expert Comment

by:kcm76
ID: 6932751
listening..
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7653936
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
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7655290
Gee.
0
 

Expert Comment

by:SpideyMod
ID: 7755228
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question