# SimConnect_RequestSystemState The **SimConnect\_RequestSystemState** function is used to request information from a number of Microsoft Flight Simulator system components.   ##### Syntax ``` cpp HRESULT SimConnect_RequestSystemState( HANDLE hSimConnect, SIMCONNECT_DATA_REQUEST_ID RequestID, const char* szState, ); ```   ##### Parameters {{< table-wrapper >}} | Parameter | Description | Type | |---------------|-------------------------------------------------------------------------------------------|---------| | *hSimConnect* | Handle to a SimConnect object. | Integer | | *RequestID* | The client defined request ID. | Integer | | *szState* | A null-terminated string identifying the system function. One from the table shown below. | String | {{< /table-wrapper >}}   The following table shows the values available for the *szState*: {{< table-wrapper >}} | String | Description | |------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `AircraftLoaded` | Requests the full path name of the last loaded aircraft flight dynamics file. These files have a .AIR extension. | | `DialogMode` | Requests whether the simulation is in Dialog mode or not. | | `FlightLoaded` | Requests the full path name of the last loaded flight. Flight files have the extension .FLT. | | `FlightPlan` | Requests the full path name of the active flight plan. An empty string will be returned if there is no active flight plan. | | `Sim` | Requests the state of the simulation. If 1 is returned, the user is in control of the aircraft, if 0 is returned, the user is navigating the UI. This is the same state that notifications can be subscribed to with the "SimStart" and "SimStop" string with the `SimConnect_SubscribeToSystemEvent` function. | {{< /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 >}}   ##### Remarks It is important to call this function sufficiently frequently that the queue of information received from the server is processed. If there are no messages in the queue, the **\[dwID\]** parameter will be set to [`SIMCONNECT_RECV_ID_NULL`](../structures-and-enumerations/simconnect-recv-id/).