Solved

Calling a help file .chm from a menu

Posted on 2002-04-10
7
414 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 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
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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
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…

749 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