SimConnect_UnsubscribeFromSystemEvent

The SimConnect_UnsubscribeFromSystemEvent function is used to request that notifications are no longer received for the specified system event.

 

Syntax
HRESULT SimConnect_UnsubscribeFromSystemEvent(
    HANDLE  hSimConnect,
    SIMCONNECT_CLIENT_EVENT_ID  EventID
    );

 

Parameters
Parameter Description Type
hSimConnect Handle to a SimConnect object. Integer
EventID Specifies the ID of the client event. Integer

 

Return Values

The function returns an HRESULT. Possible values include, but are not limited to, those in the following table.

Return value Description
S_OK The function succeeded.
E_FAIL The function failed.

 

Example
static enum EVENT_ID {
    EVENT_FLIGHT_LOAD,
    EVENT_RECUR_1SEC,
    EVENT_RECUR_FRAME, 
    };
hr = SimConnect_SubscribeToSystemEvent(hSimConnect, EVENT_RECUR_1SEC);
hr = SimConnect_UnsubscribeFromSystemEvent(hSimConnect, EVENT_RECUR_1SEC);

 

Remarks

There is no limit to the number of system events that can be subscribed to, but use this function to improve performance when a system event notification is no longer needed.

 

See Also