Function

CGRegisterScreenRefreshCallback

Registers a callback function to be invoked when local displays are refreshed or modified.

Declaration

CGError CGRegisterScreenRefreshCallback(CGScreenRefreshCallback callback, void *userInfo);

Parameters

function

A pointer to the callback function to be registered.

userParameter

A pointer to user-defined data, or NULL. The userParameter 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 call the function CGUnregisterScreenRefreshCallback to remove the registration.

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

In OS X v10.4 and earlier, the result code returned by this function is a random value and should be ignored. In macOS 10.5 and later, the result code is valid.

See Also

Getting Information About Refresh and Move Operations

CGUnregisterScreenRefreshCallback

Removes a previously registered callback function invoked when local displays are refreshed or modified.

Deprecated
CGWaitForScreenRefreshRects

Waits for screen refresh operations.

Deprecated
CGScreenRegisterMoveCallback

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

Deprecated
CGScreenUnregisterMoveCallback

Removes a previously registered callback function invoked when an area of the display is moved.

Deprecated
CGWaitForScreenUpdateRects

Waits for screen update operations.

Deprecated
CGReleaseScreenRefreshRects

Deallocates a list of rectangles that represent changed areas on local displays.

Deprecated