Sign in to follow this  
dragonflightdesign

Getting the FLT file being loaded

Recommended Posts

Is it possible? The obvious answer is to check the 'Last_Accessed' attribute on the flt file but as the operating system can defer stamping that information to the file for up to an hour, it's not really a lot of use. Finding which flt file has just been saved is relatively easy as the 'Last_Modified' attribute is stamped within two seconds. As the flt file is really just an ini file, I'd like to use it to store additional panel information associated with that flight.

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

In FSUIPC it is possible via offset 0x3F04 ( both fs9 & fsx + ) For FSX and above this is done through simconnect so it should be possible without FSUIPC.

Share this post


Link to post
Share on other sites

The SimcConnect API

HRESULT SimConnect_RequestSystemState

(

HANDLE  hSimConnect,

SIMCONNECT_DATA_REQUEST_ID  RequestID,

const char*  szState

);

 

where the null-terminated string szState identifies the system function:
 

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. See SimConnect_SetSystemState for a description of Dialog mode.

 
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.

Share this post


Link to post
Share on other sites

Thanks guys. I'm pleased to see that it can be done 'natively' because I'm desparately trying to avoid the use of any third-party addon for this project. We'll see if I succeed... :smile:

Share this post


Link to post
Share on other sites

Just a word of caution... Prepar3D v2.5 has panel state saving built in... might want to look into that before someone shoves your project into that and things get crossed. :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this