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
ParameterDescriptionType
hSimConnectHandle to a SimConnect object.Integer
EventIDSpecifies 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 valueDescription
S_OKThe function succeeded.
E_FAILThe 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.