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: More Macintosh Toolbox /
Chapter 6 - Component Manager / Component Manager Reference
Routines for Components / Capturing Components


The CaptureComponent function allows your component to capture another component. In response to this function, the Component Manager removes the
specified component from the search list of components. As a result, applications cannot retrieve information about the captured component or gain access to it. Current clients of the captured component are not affected by this function.

FUNCTION CaptureComponent (capturedComponent: Component; 
                           capturingComponent: Component)
                           : Component;
The component identifier of the component to be captured. Your component can obtain this identifier from the FindNextComponent function or from the component registration routines.
The component identifier of your component. Note that you can use the component instance (appropriately coerced) that your component received in its open request in this parameter.
The CaptureComponent function removes the specified component from the search list of components and returns a new component identifier. Your component can use this new identifier to refer to the captured component. For example, your component can open the captured component by providing this identifier to the OpenComponent function. Your component must provide this identifier to the UncaptureComponent function to specify the component to be restored to the search list.

If the component specified by the capturedComponent parameter is already captured, the CaptureComponent function returns a component identifier set to NIL.

See "Responding to the Target Request" on page 6-24 and "Targeting a Component Instance" on page 6-74 for information about target requests. For information related to the Component Manager's use of its list of available components, see page 6-40 for details on the FindNextComponent function and page 6-42 for details on the OpenDefaultComponent function. See "Registering Components" beginning on page 6-55 for details of the component registration routines.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996