Important: The information in this document is obsolete and should not be used for new development.
HMGetIndHelpMsg
To extract the help messages in existing help resources as well as additional information regarding the help resource, such as its variation code, tip location, and so on, use theHMGetIndHelpMsgfunction.
FUNCTION HMGetIndHelpMsg (whichType: ResType; whichResID, whichMsg, whichState: Integer; VAR options: LongInt; VAR tip: Point; VAR altRect: Rect; VAR theProc: Integer; VAR variant: Integer; VAR aHelpMsg: HMMessageRecord; VAR count: Integer): OSErr;
whichType- The type of help resource. You can use one of these constants:
kHMMenuResType,kHMDialogResType,kHMRectListResType,kHMOverrideResType, orkHMFinderApplResType.whichResID- The resource ID of the help resource whose help message you wish to extract.
whichMsg- The index of the component you wish to extract. The header and missing-items components don't count as components to index, because this function always skips those two components. For help resources that include both header and missing-items components, specify 1 to get the help messages contained in a help resource's menu-title component.
whichState- For menu items and items in alert and dialog boxes, specifies the state of the item whose message you wish to extract. Use one of the following constants:
kHMEnabledItem,kHMDisabledItem,kHMCheckedItem, orkHMOtherItem.options- The value of the
optionselement of the help resource.tip- The coordinates of the help balloon's tip location.
altRect- The coordinates of the help balloon's alternate rectangle.
theProc- The resource ID of the help balloon's
'WDEF'resource.variant- The balloon definition function's variation code.
aHelpMsg- The help message.
count- The number of components defined in the resource (not counting the header and missing-items components).
DESCRIPTION
Like theHMExtractHelpMsgfunction, theHMGetIndHelpMsgfunction returns in itsaHelpMsgparameter the help message for an item in a specified state. TheHMGetIndHelpMsgfunction uses additional parameters to return even more information about the help balloon than doesHMExtractHelpMsg.To retrieve all of the help balloon messages and related information for a given resource, set
whichMsgto 1 and make repeated calls toHMGetIndHelpMsg, incrementingwhichMsgby 1 on each subsequent call until it returns thehmSkippedBalloonresult code.The
whichTypeparameter identifies the type of resource from which you are extracting the help message. You can use one of these constants for thewhichTypeparameter.
CONST kHMMenuResType = 'hmnu';{menu help resource type} kHMDialogResType = 'hdlg';{dialog help resource type} kHMWindListResType = 'hwin';{window help resource type} kHMRectListResType = 'hrct';{rectangle help resource type} kHMOverrideResType = 'hovr';{help override resource } { type} kHMFinderApplResType = 'hfdr';{application icon help } { resource type}ThewhichStateparameter specifies the state of the item whose message you want to extract. You can use one of these constants for thewhichStateparameter.
CONST kHMEnabledItem = 0; {enabled state for menu items; } { contrlHilite value of 0 for } { controls} kHMDisabledItem = 1; {disabled state for menu items; } { contrlHilite value of 255 for } { controls} kHMCheckedItem = 2; {enabled-and-checked state for } { menu items; contrlHilite value } { of 1 for controls that are "on"} kHMOtherItem = 3; {enabled-and-marked state for menu } { items; contrlHilite value } { between 2 and 253 for controls}For thekHMRectListResType,kHMOverrideResType, andkHMFinderApplResTyperesource types--which don't have states--supply
thekHMEnabledItemconstant for thewhichStateparameter.SPECIAL CONSIDERATIONS
IfHMCompareItemappears as a component of an'hmnu'resource that you're examining, neither this function norHMExtractHelpMsgperforms a comparison against the current name of any menu item. Instead, these functions return the messages listed in yourHMCompareItemcomponents in the order in which they appear in the'hmnu'resource.When supplying an index for the
whichMsgparameter, don't count the header component or the missing-items component as components to index. This function always skips both components; therefore, for help resources that include both header and missing-items components, specify 1 to get the help messages contained in a help resource's menu-title component.ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for theHMGetIndHelpMsgfunction are
Trap macro Selector _Pack14 $1306 RESULT CODES
SEE ALSO
TheaHelpMsgparameter is of data typeHMMessageRecord. "Providing Help Balloons for Dynamic Windows" beginning on page 3-69 describes the fields of the help message record.