Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Processes
Chapter 5 - Notification Manager


Summary of the Notification Manager

Pascal Summary

Constant

CONST
   nmType            = 8;              {queue type of notification queue}

Data Types

TYPE NMRec =
   RECORD
      qLink:         QElemPtr;         {next queue entry}
      qType:         Integer;          {queue type}
      nmFlags:       Integer;          {reserved}
      nmPrivate:     LongInt;          {reserved}
      nmReserved:    Integer;          {reserved}
      nmMark:        Integer;          {item to mark in menu}
      nmIcon:        Handle;           {handle to icon}
      nmSound:       Handle;           {handle to sound resource}
      nmStr:         StringPtr;        {string to appear in alert box}
      nmResp:        ProcPtr;          {pointer to response procedure}
      nmRefCon:      LongInt;          {for application's use}
   END;
   NMRecPtr = ^NMRec;

Notification Manager Routines

FUNCTION NMInstall(nmReqPtr: NMRecPtr): OSErr;
FUNCTION NMRemove(nmReqPtr: NMRecPtr): OSErr;

Application-Defined Routine

PROCEDURE MyResponse(nmReqPtr: NMRecPtr);

C Summary

Constant

enum {nmType         = 8};             /*queue type of notification queue*/

Data Types

typedef pascal void (*NMProcPtr)(struct NMRec *);
struct NMRec {
      QElemPtr       qLink;            /*next queue entry*/
      short          qType;            /*queue type*/
      short          nmFlags;          /*reserved*/
      long           nmPrivate;        /*reserved*/
      short          nmReserved;       /*reserved*/
      short          nmMark;           /*item to mark in menu*/
      Handle         nmIcon;           /*handle to icon*/
      Handle         nmSound;          /*handle to sound resource*/
      StringPtr      nmStr;            /*string to appear in alert box*/
      NMProcPtr      nmResp;           /*pointer to response procedure*/
      long           nmRefCon;         /*for application's use*/
};
typedef struct NMRec NMRec;
typedef NMRec *NMRecPtr;

Notification Manager Routines

pascal OSErr NMInstall(NMRecPtr nmReqPtr);
pascal OSErr NMRemove(NMRecPtr nmReqPtr);

Application-Defined Routine

pascal void MyResponse(NMRecPtr nmReqPtr);

Result Codes
noErr0No error
qErr-1Not in queue
nmTypErr-299Invalid qType value (must be ORD(nmType))


Previous Book Contents Book Index Next

© Apple Computer, Inc.
17 JUN 1996