Important: The information in this document is obsolete and should not be used for new development.
MyDlgHook
A dialog hook function should have the following form:
FUNCTION MyDlgHook (item: Integer; theDialog: DialogPtr; myDataPtr: Ptr): Integer;
item
- The number of the item selected.
theDialog
- A pointer to the dialog record of the dialog box.
myDataPtr
- A pointer to the optional data whose address is passed to
CustomGetFile
orCustomPutFile
.DESCRIPTION
You supply a dialog hook function to handle user selections of items that you added
to a dialog box. If you provide a dialog hook function,CustomPutFile
andCustomGetFile
call your function immediately after callingModalDialog
. They
pass your function the item number returned byModalDialog
, a pointer to the
dialog record, and a pointer to the data received from your application, if any.Your dialog hook function returns as its function result an integer that is either the item number passed to it or some other item number. If your dialog hook function does not handle a selection, it should pass the item number back to the Standard File Package for processing by setting its return value equal to the item number. If your dialog hook function does handle the selection, it should pass back
sfHookNullEvent
or the number of some other pseudo-item.SEE ALSO
See "Writing a Dialog Hook Function" on page 3-21 for a sample dialog hook function.