The SimConnect_RequestSystemState function is used to request information from a number of Microsoft Flight Simulator system components.


HRESULT SimConnect_RequestSystemState(
    HANDLE  hSimConnect,
    const char*  szState,


Parameter Description Type
hSimConnect Handle to a SimConnect object. Integer
RequestID The client defined request ID. Integer

A null-terminated string identifying the system function. One from the table shown below.



The following table shows the values available for the szState:

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.


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.



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 .


See Also