ACC: How to Call the Windows Help Search Dialog BoxID: Q109826
|
Advanced: Requires expert coding, interoperability, and multiuser skills.
This article describes how to call the Windows Help Search dialog box
from within your Microsoft Access application using the WinHelp() and
FindWindow() Windows API function calls.
This article assumes that you are familiar with Access Basic and with
creating Microsoft Access applications using the programming tools provided
with Microsoft Access. For more information on Access Basic, please refer
to the "Introduction to Programming" manual in Microsoft Access version
1.x, or the "Building Applications" manual, Chapter 3, "Introducing Access
Basic," in version 2.0.
The following example demonstrates how to activate the Search dialog box
with a sample Access Basic function called OpenHelpSearch(). This example
uses the Microsoft Access Help file:
NOTE: In the following sample code, an underscore (_) is used as a line-
continuation character. Remove the underscore from the end of the line when
re-creating this code in Access Basic.
Option Explicit
Global Const HELP_PARTIALKEY = &H105
Declare Function WinHelp Lib "User" (ByVal hWnd As _
Integer, ByVal lpHelpFile As String, ByVal _
wCommand As Integer, ByVal dwData As Any) As Integer
Declare Function HC_FindWindow% Lib "user" Alias "FindWindow" _
(ByVal lpClassName As Any, ByVal lpCaption As Any)
Function OpenHelpSearch ()
Dim DummyVal$, Temp%
DummyVal$ = ""
Temp% = WinHelp(GetAccessHandle(),_
"c:\Access\msaccess.hlp", HELP_PARTIALKEY, DummyVal$)
'For version 2.0, replace Temp% = etc with the following:
'Temp% = WinHelp(GetAccessHandle(),_
' "c:\Acc2\msacc20.hlp", HELP_PARTIALKEY, DummyVal$)
End Function
Function GetAccessHandle ()
GetAccessHandle = HC_FindWindow("Omain", 0&)
End Function
"Programming Windows: The Microsoft Guide to Writing Applications
for Windows 3," Charles Petzold, Microsoft Press, 1990
"Programmer's Reference Library: Microsoft Windows 3.1 Guide to
Programming Reference," Volumes 1-6, Microsoft Press, 1992
Keywords : kbprg
Version : 1.0 1.1 2.0
Platform : WINDOWS
Issue type : kbhowto
Last Reviewed: April 1, 1999