RegisterAppStateChangeNotification function

Enables an app to register a callback function through which it can be notified that its library is going into or coming out of a suspended state. The app can use this information to perform any necessary operations, such as preserving state, that should be performed at that point.

Syntax

APICONTRACT ULONG RegisterAppStateChangeNotification(
  PAPPSTATE_CHANGE_ROUTINE Routine,
  PVOID                    Context,
  PAPPSTATE_REGISTRATION   *Registration
);

Parameters

Routine

A pointer to a callback function that is called when the app enters or leaves the suspended state. See PAPPSTATE_CHANGE_ROUTINE for more detail on this function.

Context

App-specific context information that the app uses when going into or out of a suspended state. This is commonly a "this" pointer.

Registration

When this function returns successfully, this parameter receives the address of a pointer to a value that can be used to identify the registration. Store this value to use with UnregisterAppStateChangeNotification.

Return Value

A standard Win32 status code.

Requirements

   
Target Platform Windows
Header appnotify.h
Library Appnotify.lib
DLL Twinapi.core.dll

See Also

UnregisterAppStateChangeNotification