How to activate Search in Windows Help
If you have your own help file for your application, you might want to have the usual Help - Search menu. This is how to do it:
Author: rich_jones@wmg.com' *** The Declares ' *** below is all one line *** Declare Function WinHelp% Lib "User" (ByVal hWnd%, ByVal lpHelpFile$, ByVal wCommand%, ByVal dwData As Any) ' *** Context Help ID's *** Global Const hlpDisplayUser = 40 Global Const hlpContents = 1 Global Const hlpRunApp = 20 Global Const hlpGetStarted = 10 Global Const hlpCloseRun = 1 Global Const HELP_QUIT = 2 Global Const HELP_INDEX = 3 Global Const HELP_HELPONHELP = 4 Global Const HELP_PARTIALKEY = &H105 '*** Add a menu option HELP, then add the Contents, Search, and How to use Help '*** Form1 is the current form, you can use ME is you want '*** the App.Helpfile must be set in the project somewhere in the beginning '***** Contents command ' Sub mnuHelpContents_Click() Dim i As Integer i = WinHelp(Form1.hWnd, App.HelpFile, HELP_INDEX, 0&) End Sub '***** Search for Help... command (the "" can be a search value if you want) ' Sub mnuSearchHelp_Click() Dim i As Integer i = WinHelp(Form1.hWnd, App.HelpFile, HELP_PARTIALKEY, "") End Sub '***** How to Use Help command ' Sub mnuHowToUseHelp_Click() Dim i As Integer i = WinHelp(Form1.hWnd, App.HelpFile,HELP_HELPONHELP, 0&) End Sub '*** To unload WinHelp when your App closes ' Sub Form_Unload(Cancel as Integer) Dim i As Integer i = WinHelp(Form1.hWnd, App.HelpFile,HELP_QUIT, 0&) End Sub |
||
Editor: rich_jones@wmg.com Last update: 2025-03-11 Copyright 1995-2025 VBI ![]() |