home *** CD-ROM | disk | FTP | other *** search
- /*
- ** aevent.c
- **
- ** This module contains all the code for the program to handle the
- ** required Apple Events. Of the four types, only two really
- ** pertain to the program (open and quit) with quit
- ** being the only used.
- */
-
- #ifndef THINK_C
- /* #include <all the macintosh headers... */
- #include <AppleEvents.h>
- #include <Desk.h>
- #include <Dialogs.h>
- #include <Events.h>
- #include <Fonts.h>
- #include <GestaltEqu.h>
- #include <Menus.h>
- #include <OSEvents.h>
- #include <QuickDraw.h>
- #include <ToolUtils.h>
- #include <Types.h>
- #include <Windows.h>
- #else
- #include "ak_headers"
- #endif
- #include "aevent.h"
- #include "appkiller.h"
-
-
- static OSErr QuitHandler(AppleEvent, AppleEvent, long);
-
-
- void InitAEs(void)
- {
- OSErr err;
-
- /* install event handlers for the core apple events. */
- err = AEInstallEventHandler(kCoreEventClass, kAEQuitApplication,
- QuitHandler, 0, FALSE);
- } /* InitAEs() */
-
-
- void DoAppleEvent(EventRecord *theEvent)
- {
- OSErr err;
- err = AEProcessAppleEvent(theEvent);
- } /* DoAppleEvent() */
-
- /*=================================== HANDLERS FOLLOW... */
-
- static OSErr QuitHandler(AppleEvent theAppleEvent,
- AppleEvent reply, long handlerRefcon)
- {
- Cleanup();
- } /* QuitHandler() */
-
-