Contents

CGScreenRegisterMoveCallback(_:_:)

Registers a callback function to be invoked when an area of the display is moved.

Declaration

func CGScreenRegisterMoveCallback(_ callback: CGScreenUpdateMoveCallback, _ userInfo: UnsafeMutableRawPointer?) -> CGError

Parameters

  • callback:

    A pointer to the callback function to be registered.

  • userInfo:

    A pointer to user-defined data, or NULL. The userInfo argument is passed back to the callback function each time it’s invoked.

Return Value

A result code. See Core Graphics Data Types and Constants.

Discussion

A callback function may be registered multiple times with different user-defined data pointers, resulting in multiple registration entries. For each registration, when notification is no longer needed, you should remove the registration by calling the function CGScreenUnregisterMoveCallback(_:_:).

The callback function you register is invoked only if your application has an active event loop. The callback is invoked in the same thread of execution that is processing events within your application.

Special Considerations

This function is implemented in macOS 10.4.3 and later.

See Also

Functions