ReplaceGestalt
ReplaceGestalt Replace the function associated with a selector
#include <GestaltEqu.h> Gestalt Manager
OSErr ReplaceGestalt( selector, selectorFunction , oldGestaltFunction );
OSType selector ; Gestalt selector code
ProcPtr selectorFunction ; address of new selector function
ProcPtr *oldGestaltFunction ; address of current selector function
returns Error Code; 0=no error
ReplaceGestalt lets your application replace the function currently
associated with a selector.
selector is the code that is about to have its function replaced(see
Using the Gestalt Manager for a list of selector
codes).
selectorFunction is the new function Gestalt will associate with the
selector.
oldGestaltFunction is the function currently associated with the selector and
about to be replaced
Returns: an operating system Error Code. It will be one of:
noErr (0) No error
gestaltUndefSelectorErr (-5551) Un defined selector
gestaltLocationErr (-5553) Function not in system heap

Notes: The new function must reside in the system heap and may want to call the
function previously associated with the named selector. It may do so by
using the address returned in the oldGestaltFunction.
Under THINK C 5.0 or later, THINK Pascal 4.0 or later and MPW 3.2 or
later, ReplaceGestalt will return an unimpErr on systems which do not
support the Gestalt Manager. If you are programming in assembly
language, it is necessary to check for the existence of the
Gestalt Manager before calling ReplaceGestalt. See
Using the Gestalt Manager for more information on determining if the
Gestalt Manager is supported.