Solved

Calling a help file .chm from a menu

Posted on 2002-04-10
7
408 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
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 100 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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

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 …
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

744 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now