HMExtractHelpMsg
whichState, aHelpMsg );
ResType whichType ; specifies the format of the help message short whichResID ; the resource ID of the help resource whose content
you wish to extract.
short whichMsg ; Specifies the index of the component you wish to
extract.
short whichState ; specifies the state of the item whose message you
wish to extract.
specified in existing help resources.
whichType specifies the format of the help message. Supply one of these
constants.kHMMenuResType, kHMDialogResType,
kHMRectListResType, kHMOverrideResType,
kHMFinderApplResType
Note: If HMCompareItem appears as a component of an
'hmnu' resource that you're examining, neither this
comparison against the current name of any menu item.
Instead, these functions return the messages listed in
your HMCompareItem components in the order in which
they appear in the 'hmnu' resource.
whichMsg specifies the index of the component you wish to extract. (Do not
count the header information as a component to index.) After the
header information, for example, the first component in a menu help
resource defines help for missing items; the second item defines help
for the menu title.
whichResI the resource ID of the help resource whose content you wish to
extract. Specify the index of the component you wish to extract in the
whichMsg parameter. (Do not count the header information as a
component to index.) After the header information, for example, the
first component in a menu help resource defines help for missing
items; the second item defines help for the menu title.
whichState specifies the state of the item whose message you wish to extract.
Use one of the following constants for the whichState parameter. For
the kHMRectListResType, kHMOverrideResType, and
kHMFinderApplResType resource types-which do not have
states-supply the kHMEnabledItem constant for the whichState
parameter.
aHelpMsg a help message record . The aHelpMsg parameter is of data type
describes the fields of this record.
noErr (0) No error
paramErr (-50) Error in parameter list
memFullErr (-108) Not enough room in heap zone
resNotFound (-192) Unable to read resource
hmSkipBalloon (-857) No balloon content to fill in
hmUnknownHelpType (-859) Help message record contained a bad type
Notes: In the following example, a menu help resource has a resource ID of 128. A
2 is supplied as the whichMsg parameter to retrieve information about the
resource's second component (the second component after the header, that
is), which is the menu title. The menu title has four possible states; to
retrieve the help message for the menu title in its dimmed state, the
constant kHMDisabledItem is used for the whichState parameter. The help
message record returned in aHelpMsg is then passed to
tip located at the point specified in the tip parameter.
#include <Balloons.h>
void MyExtractHelpMsg ( )
{
kHMDisabledItem, & aHelpMsg);
if (rc == noErr)
// be sure to assign a tip and rectangle coordinates here
0,0, kHMRegularWindow);
}
To retrieve all of the help balloon messages for a given resource, set
incrementing whichMsg by 1 on each subsequent call until it returns the
hmSkippedBalloon result code.