HelpContextID is a property of all of the controls that can gain focus, and it provides the link between the control and its matching Help topic for context-sensitive help. All three of the help engines—DOS, WinHelp and HTML Help—recognize and use the context IDs.
nID = Object.HelpContextID
oObject.HelpContextID = nID
The HelpContextID property is one of the more common among objects, belonging to everything from _SCREEN to option buttons. Use the SYS(1023) and SYS(1024) functions to determine the HelpContextIDs of the forms and buttons on built-in dialogs you want to include in your application.
Menus lack a facility for adding HelpContextIDs to developer-created pads and bars. |
HelpContextIDs offer a great opportunity for an enterprising third-party developer. Someone could write builders and wizards for quick data entry of context-sensitive help from within the design surfaces, scanning and auditing programs to ensure help file coverage, and automating generation of IDs by scanning projects and their associated files. In fact, someone already has; check out West Wind HTML Help Builder at www.west-wind.com.
HelpContextIDs seem to be limited in range to ±2,147,483,647, but we think that 2^32 separate help topics should be enough for most of our systems.
* We've created a help file where we want a standard
* "this is what happens if you select quit" help topic.
* We've assigned that topic HelpContextID 37 in the HLP file.
* In each of the forms where we want that help, we
* assign the topic to the associated buttons:
oForm.btnQuit.HelpContextID = 37 && Standard 'Quit' help
* Actually, we can do this just once if we make it part of a
* quit button class.