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 / Using the Notification Manager

Installing a Notification Request

To add a notification request to the notification queue, call the NMInstall function. For example, you can install the notification request defined in Listing 5-1 with the following line of code:

myErr := NMInstall(@gMyNotification);     {install request}
If the call to NMInstall returns an error, then you cannot install the notification request in the notification queue. In that case, your application should wait for the user to switch it to the foreground before doing further processing. While waiting for a resume event, your application should take care of other events, such as updates. Note, however, that NMInstall fails only if it is passed invalid information, namely, the wrong value for qType.

You can install notification requests at any time, even when the system is executing 'INIT' resources as part of the system startup sequence. If you need to notify the user of some important occurrence during the execution of your 'INIT' resource, use the Notification Manager to install a request in the notification queue. The system notifies the user after the startup process completes, that is, when the normal event mechanism begins. This saves you from having to interrupt the system startup sequence with dialog or alert boxes and results in a cleaner and more uniform startup appearance.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
17 JUN 1996