Removes a handler from a special handler dispatch table.
- macOS 10.0+
- Core Services
A universal procedure pointer to the special handler to remove. Although the
functionparameter is sufficient to identify the handler to remove, you can identify the handler explicitly as a safeguard. If you pass
NULLfor this parameter, the Apple Event Manager relies solely on the function class to identify the handler. See
Specifies the special handler dispatch table to remove the handler from. Pass
TRUEto remove the handler from the system special handler dispatch table or
FALSEto remove the handler from your application’s special handler dispatch table. Use of the system special handler dispatch table is not recommended.
A result code. See Result Codes.
Thread safe starting in OS X v10.2.
Your application should not install a special handler in a system dispatch table with the goal that the handler will get called when other applications receive events—this won’t work in macOS.
In some previous versions of the Mac OS, applications might have reason to disable, within the application only, all Apple Event Manager functions that support Apple event objects—that is, all the functions available to an application as a result of linking the Object Support Library (OSL) and calling the
To disable the OSL, you should pass the keyword
key in the
NULL in the
handler parameter, and
FALSE in the
is parameter. An application that expects its copy of the OSL to move after it is installed—for example, an application that keeps it in a stand-alone code resource—would need to disable the OSL. When an application calls
AEObject to initialize the OSL, the OSL installs the addresses of its functions as extensions to the pack. If those functions move, the addresses become invalid.
Once you have called the
AERemove function to disable the OSL, subsequent calls by your application to any of the Apple Event Manager functions that support Apple event objects will return errors. To initialize the OSL after disabling it with the
AERemove function, your application must call
If you expect to initialize the OSL and disable it several times, you should call
AERemove to remove your application’s object accessor functions from your application’s object accessor dispatch table before you call