Discussion:
Hilfe im eigenem Fenster öffnen
(zu alt für eine Antwort)
Rafael Grybs
2004-04-26 11:56:42 UTC
Permalink
Hallo NG,

ich versuche, wie im Microsoft Knowledge Base Article - 275117 beschrieben,
meine eigene Online-Hilfe als *.chm-Datei in einem neuen Fenster zu öffnen.
Leider wird das Fenster nicht geöffnet und es erscheint auch keine
Fehlermeldung.
Ich verwende A2000. Weisst da jemand was?

Grüsse
Rafael
Andreas Kuehnel
2004-04-26 18:13:27 UTC
Permalink
HAllo Rafael,

ich weiß nicht, was i Artikel steht, aber ich installiere meine Hilfedatei
immer nach dem folgenden Rezept.
Das klappt sehr gut.

Viel Erfolg

Andreas





Using HTML Help With Microsoft Access
Updated April 25, 2000
The main thing to remember is that Access 97 was released about the same
time as HTML Help, so there is zero support for this particular help system
from Access 97. For example, you won't be able to use the help functionality
of the MsgBox function with HTML Help as it only works with WinHelp. The way
to fix this particular problem is to use the freeware HHMsgBox DLL.

You can snag code out of the HTML Help class module to call topics from a
menu, command buttons, etc. However, there's a problem with this. Access
doesn't seem to have a working equivalent to VB's App.Path property to
retrieve the path of the application. The workaround is to register your
HTML Help file name and path in
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\HTML Help. Once you do this,
calling a help topic uses the name of the file only. The HTML Help engine
will check the registry for the path. Here's how to open an HTML Help file
to a topic this way, where 1030 is the topics mapped ID:

Private Const HH_HELP_CONTEXT = &HF

Private Declare Function HTMLHelpStdCall Lib "hhctrl.ocx" _
Alias "HtmlHelpA" (ByVal hwnd As Long, _
ByVal lpHelpFile As String, _
ByVal wCommand As Long, _
ByVal dwData As Long) As Long

Private Sub cmdTopicID_Click()
HTMLHelpStdCall 0, "myhelp.chm, HH_HELP_CONTEXT, 1030
End Sub

Creating menus isn't so easy. Drop the following code into a module:

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

' UDT for accessing the Search tab
Private Type tagHH_FTS_QUERY
cbStruct As Long
fUniCodeStrings As Long
pszSearchQuery As String
iProximity As Long
fStemmedSearch As Long
fTitleOnly As Long
fExecute As Long
pszWindow As String
End Type

Private Declare Function HTMLHelpStdCall Lib "hhctrl.ocx" _
Alias "HtmlHelpA" (ByVal hwnd As Long, _
ByVal lpHelpFile As String, _
ByVal wCommand As Long, _
ByVal dwData As Long) As Long

Private Declare Function HTMLHelpCallSearch Lib "hhctrl.ocx" _
Alias "HtmlHelpA" (ByVal hwnd As Long, _
ByVal lpHelpFile As String, _
ByVal wCommand As Long, _
ByRef dwData As tagHH_FTS_QUERY) As Long

Public Function ShowContents() As Long

ShowContents = HTMLHelpStdCall(0, "myhelp.chm", HH_DISPLAY_TOC, 0)

End Function

Public Function ShowIndex() As Long

ShowIndex = HTMLHelpStdCall(0, "myhelp.chm", HH_DISPLAY_INDEX, 0)

End Function

Public Function ShowSearch() As Long

Dim HH_FTS_QUERY As tagHH_FTS_QUERY

With HH_FTS_QUERY
.cbStruct = Len(HH_FTS_QUERY)
.fUniCodeStrings = 0&
.pszSearchQuery = ""
.iProximity = 0&
.fStemmedSearch = 0&
.fTitleOnly = 0&
.fExecute = 1&
.pszWindow = ""
End With

ShowSearch = HTMLHelpCallSearch(0, _
"myhelp.chm", _
HH_DISPLAY_SEARCH, HH_FTS_QUERY)

End Function

Create three new RunCode macros to call these three procedures. These will
open the help file to the Contents, Index, and Search tabs respectively. In
the toolbar customize dialog, create a new toolbar named HTMLHelp, then drop
a new menu on it to turn it into a menu bar. Rename this to &Help. Then,
using the same toolbar customize dialog, drop each of these macro commands
onto the menu and rename them to &Contents, &Index, and &Search. They'll
then work as expected.

One of the strangest issues I've found is that, while Access uses What's
This popups correctly, it won't let you do the same. For example, in Access
2000, if you set the HelpFile property of a form to the name of an HTML Help
file, and set the HelpContextID of the same form to a known context integer,
pressing F1 when the form is open will open the HTML Help file to that
topic. However, the whole of it gets opened into the Office 2000 help system
instead of any window you've specified.

The same thing happens if you set the HelpContextID of a control, even if
it's implemented via the What's This Button on the top right of the form.
The What's This button is described in the Access 2000 help as follows:

"With the question-mark pointer, you can click any control to access its
custom Help topic specified by the control's HelpContextID property. If the
control doesn't have a custom Help topic, the form's custom Help topic is
displayed. If neither the form or the control has a custom Help topic,
Microsoft Access Help is displayed."

Looking into this further, clicking the What's This pointer on the titlebar
on the form doesn't fire a WM_HELP message as in other applications, but
looking at the WinHelp messages in Microsoft's WinHelp Help Compiler
Workshop shows that it's calling one of Access's help files:

HELP_SETPOPUP_POS: 611 251
HELP_CONTEXTPOPUP: 3763 -- C:\Program Files\Microsoft
Office\Office\1033\actip9.hlp

However, clicking on a control in an app that's set up to use one of my own
topics reveals this:

HELP_CONTEXT: 10040 -- D:\ProAccess\sample\context.hlp>MAIN
Processing D:\ProAccess\sample\context.GID

It appears they're calling WinHelp directly instead of firing a WM_HELP
message so they can use HELP_CONTEXT for your own help topics vs. the
default WM_HELP mechanism.

What this means is that Access 2000 doesn't really have any workable What's
This Help as users have come to expect it. What's This in Access 2000 opens
a topic in a standard help window rather than as a popup. This is true even
if the What's This source file is HTML Help or WinHelp.

So, when it comes to Access of any variety, use menus and call custom topics
from command buttons to your heart's content. But leave What's This help
alone.
Post by Rafael Grybs
Hallo NG,
ich versuche, wie im Microsoft Knowledge Base Article - 275117
beschrieben,
Post by Rafael Grybs
meine eigene Online-Hilfe als *.chm-Datei in einem neuen Fenster zu öffnen.
Leider wird das Fenster nicht geöffnet und es erscheint auch keine
Fehlermeldung.
Ich verwende A2000. Weisst da jemand was?
Grüsse
Rafael
Rafael Grybs
2004-04-27 07:26:26 UTC
Permalink
Hallo Andreas,

danke für deinen Beitrag. Ich habe zwischenzeitlich das schon hingekriegt.
Beim Drücken der F1-Taste wird meine Hilfe aufgerufen statt der
Access-Hilfe. Das einzige, was bleibt, ist dass beim Selektieren eines
Menüeintrags aus der Menüleiste und gleichzeitigem Drücken der F1-Taste
immer noch die Access-Hilfe aufpoppt.
Wie bringe ich der Command-Bar bei, dass sie meine Hilfe einblenden soll?

Gruss
Rafael
Post by Andreas Kuehnel
HAllo Rafael,
ich weiß nicht, was i Artikel steht, aber ich installiere meine Hilfedatei
immer nach dem folgenden Rezept.
Das klappt sehr gut.
Viel Erfolg
Andreas
Using HTML Help With Microsoft Access
Updated April 25, 2000
The main thing to remember is that Access 97 was released about the same
time as HTML Help, so there is zero support for this particular help system
from Access 97. For example, you won't be able to use the help
functionality
Post by Andreas Kuehnel
of the MsgBox function with HTML Help as it only works with WinHelp. The way
to fix this particular problem is to use the freeware HHMsgBox DLL.
You can snag code out of the HTML Help class module to call topics from a
menu, command buttons, etc. However, there's a problem with this. Access
doesn't seem to have a working equivalent to VB's App.Path property to
retrieve the path of the application. The workaround is to register your
HTML Help file name and path in
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\HTML Help. Once you do this,
calling a help topic uses the name of the file only. The HTML Help engine
will check the registry for the path. Here's how to open an HTML Help file
Private Const HH_HELP_CONTEXT = &HF
Private Declare Function HTMLHelpStdCall Lib "hhctrl.ocx" _
Alias "HtmlHelpA" (ByVal hwnd As Long, _
ByVal lpHelpFile As String, _
ByVal wCommand As Long, _
ByVal dwData As Long) As Long
Private Sub cmdTopicID_Click()
HTMLHelpStdCall 0, "myhelp.chm, HH_HELP_CONTEXT, 1030
End Sub
Private Const HH_DISPLAY_TOC = &H1
Private Const HH_DISPLAY_INDEX = &H2
Private Const HH_DISPLAY_SEARCH = &H3
' UDT for accessing the Search tab
Private Type tagHH_FTS_QUERY
cbStruct As Long
fUniCodeStrings As Long
pszSearchQuery As String
iProximity As Long
fStemmedSearch As Long
fTitleOnly As Long
fExecute As Long
pszWindow As String
End Type
Private Declare Function HTMLHelpStdCall Lib "hhctrl.ocx" _
Alias "HtmlHelpA" (ByVal hwnd As Long, _
ByVal lpHelpFile As String, _
ByVal wCommand As Long, _
ByVal dwData As Long) As Long
Private Declare Function HTMLHelpCallSearch Lib "hhctrl.ocx" _
Alias "HtmlHelpA" (ByVal hwnd As Long, _
ByVal lpHelpFile As String, _
ByVal wCommand As Long, _
ByRef dwData As tagHH_FTS_QUERY) As Long
Public Function ShowContents() As Long
ShowContents = HTMLHelpStdCall(0, "myhelp.chm", HH_DISPLAY_TOC, 0)
End Function
Public Function ShowIndex() As Long
ShowIndex = HTMLHelpStdCall(0, "myhelp.chm", HH_DISPLAY_INDEX, 0)
End Function
Public Function ShowSearch() As Long
Dim HH_FTS_QUERY As tagHH_FTS_QUERY
With HH_FTS_QUERY
.cbStruct = Len(HH_FTS_QUERY)
.fUniCodeStrings = 0&
.pszSearchQuery = ""
.iProximity = 0&
.fStemmedSearch = 0&
.fTitleOnly = 0&
.fExecute = 1&
.pszWindow = ""
End With
ShowSearch = HTMLHelpCallSearch(0, _
"myhelp.chm", _
HH_DISPLAY_SEARCH, HH_FTS_QUERY)
End Function
Create three new RunCode macros to call these three procedures. These will
open the help file to the Contents, Index, and Search tabs respectively. In
the toolbar customize dialog, create a new toolbar named HTMLHelp, then drop
a new menu on it to turn it into a menu bar. Rename this to &Help. Then,
using the same toolbar customize dialog, drop each of these macro commands
onto the menu and rename them to &Contents, &Index, and &Search. They'll
then work as expected.
One of the strangest issues I've found is that, while Access uses What's
This popups correctly, it won't let you do the same. For example, in Access
2000, if you set the HelpFile property of a form to the name of an HTML Help
file, and set the HelpContextID of the same form to a known context integer,
pressing F1 when the form is open will open the HTML Help file to that
topic. However, the whole of it gets opened into the Office 2000 help system
instead of any window you've specified.
The same thing happens if you set the HelpContextID of a control, even if
it's implemented via the What's This Button on the top right of the form.
"With the question-mark pointer, you can click any control to access its
custom Help topic specified by the control's HelpContextID property. If the
control doesn't have a custom Help topic, the form's custom Help topic is
displayed. If neither the form or the control has a custom Help topic,
Microsoft Access Help is displayed."
Looking into this further, clicking the What's This pointer on the titlebar
on the form doesn't fire a WM_HELP message as in other applications, but
looking at the WinHelp messages in Microsoft's WinHelp Help Compiler
HELP_SETPOPUP_POS: 611 251
HELP_CONTEXTPOPUP: 3763 -- C:\Program Files\Microsoft
Office\Office\1033\actip9.hlp
However, clicking on a control in an app that's set up to use one of my own
HELP_CONTEXT: 10040 -- D:\ProAccess\sample\context.hlp>MAIN
Processing D:\ProAccess\sample\context.GID
It appears they're calling WinHelp directly instead of firing a WM_HELP
message so they can use HELP_CONTEXT for your own help topics vs. the
default WM_HELP mechanism.
What this means is that Access 2000 doesn't really have any workable What's
This Help as users have come to expect it. What's This in Access 2000 opens
a topic in a standard help window rather than as a popup. This is true even
if the What's This source file is HTML Help or WinHelp.
So, when it comes to Access of any variety, use menus and call custom topics
from command buttons to your heart's content. But leave What's This help
alone.
Post by Rafael Grybs
Hallo NG,
ich versuche, wie im Microsoft Knowledge Base Article - 275117
beschrieben,
Post by Rafael Grybs
meine eigene Online-Hilfe als *.chm-Datei in einem neuen Fenster zu
öffnen.
Post by Rafael Grybs
Leider wird das Fenster nicht geöffnet und es erscheint auch keine
Fehlermeldung.
Ich verwende A2000. Weisst da jemand was?
Grüsse
Rafael
Lesen Sie weiter auf narkive:
Loading...