# SimConnect_SetSystemEventState The **SimConnect\_SetSystemEventState** function is used to turn requests for event information from the server on and off.   ##### Syntax ``` cpp HRESULT SimConnect_SetSystemEventState( HANDLE hSimConnect, SIMCONNECT_CLIENT_EVENT_ID EventID, SIMCONNECT_STATE dwState ); ```   ##### Parameters {{< table-wrapper >}} | Parameter | Description | Type | |---------------|----------------------------------------------------------------------------------------------------------------------------|---------| | *hSimConnect* | Handle to a SimConnect object. | Integer | | *EventID* | Specifies the ID of the client event that is to have its state changed. | Integer | | *dwState* | Double word containing the state (one member of [SIMCONNECT\_STATE](../structures-and-enumerations/simconnect-state/)). | Integer | {{< /table-wrapper >}}   ##### Return Values The function returns an **HRESULT**. Possible values include, but are not limited to, those in the following table. {{< table-wrapper >}} | Return value | Description | |--------------|-------------------------| | S\_OK | The function succeeded. | | E\_FAIL | The function failed. | {{< /table-wrapper >}}   ##### Example ``` cpp static enum EVENT_ID { EVENT_FLIGHT_LOAD, EVENT_RECUR_1SEC, EVENT_RECUR_FRAME, }; hr = SimConnect_SubscribeToSystemEvent(hSimConnect, EVENT_FLIGHT_LOAD, "FlightLoaded"); hr = SimConnect_SubscribeToSystemEvent(hSimConnect, EVENT_RECUR_1SEC, "1sec"); hr = SimConnect_SubscribeToSystemEvent(hSimConnect, EVENT_RECUR_FRAME, "frame"); hr = SimConnect_SetSystemEventState(hSimConnect, EVENT_RECUR_FRAME, SIMCONNECT_STATE_OFF); ```   ##### Remarks If this function is not called, the default is for the state to be on. This is different from input events, which have a default state of off.   Use this function to turn system events temporarily on and off, rather than make multiple calls to [SimConnect\_SubscribeToSystemEvent](simconnect-subscribetosystemevent/) and [SimConnect\_UnsubscribeFromSystemEvent](simconnect-unsubscribefromsystemevent/), which is less efficient.