Jump to content

How to get your application form (UI) appear on top of FS ?


Recommended Posts

I am writing my first add-on for FS in C# (.NET). I have gotten to the point that I can declare a hot key as well as a menu entry.

I see my menu entry appear under Modules and for what I notice both the key and the menu activation are detected. Basically I poll the Menu and Hot Keys and then my programmed classes raise an event (callback) whenever any of these two are detected.

I start my application outside FS because I do not know how you can start it from within FS (such as IvAp does).

What I wanted was that when my entry in the Modules Menu is activated, that my application would pop up on top of the current view/panel just the same way IvAp or FsPassenger do. So my app. gets called back when the menu activation is detected and the application sets focus on itself but it never pops up on top of flight simulator. I guess it is because the app itself gets focus within itself but not within the desktop (of which FS is currently the owner of the desktop focus).

Can anybody enlighten me how this can be done? I see for example that FSPassengers (I have a demo only) automatically starts whenever you startup FS.

Link to comment
Share on other sites

What I wanted was that when my entry in the Modules Menu is activated, that my application would pop up on top of the current view/panel just the same way IvAp or FsPassenger do. So my app. gets called back when the menu activation is detected and the application sets focus on itself but it never pops up on top of flight simulator.

If your application is not part of the FS process, which it is not, then you can only do what you want if you run FS in Windowed mode. You simply use one of the standard Windows APIs to gain foreground status (bring window to top, or similar).

If FS is running as a full window application it effectively "owns" the screen, and there is really no way you can get Wnidows space short of minimizing it (sending its Window a minimise command).

The other programs you mention are written as FS components, DLLs, like FSUIPC, so they are inside the FS process and can get Wnidows displayed. However, it is still very difficult to get anything displayed with FS still running -- you get flashing whilst FS displays new frames. I'm not sure how some manage.

If your display involves 128 characters or less you can use the Messages facilities in FSUIPC (see offsets 32FA and 3380). Radar Contact uses these facilities for its menus.

For FSX SimConnect does offer a fuller menu facility if you use it directly instead of going via FSUIPC.

Regards

Pete

Link to comment
Share on other sites

I see, I was thinking that perhaps FS passenger had achieved this by making itself a panel gauge in each of the planes that are delivered with it but I guess I was wrong.

Any idea where I can get info about how to make a DLL application that can run as part of FS? I write my progs in C# so I wonder if that would be possible given FS is not a managed application.

Link to comment
Share on other sites

I see, I was thinking that perhaps FS passenger had achieved this by making itself a panel gauge in each of the planes that are delivered with it but I guess I was wrong.

I don't have the program so I don't know. That is certainly one way of doing it -- a complex install, but certainly achievable.

Any idea where I can get info about how to make a DLL application that can run as part of FS? I write my progs in C# so I wonder if that would be possible given FS is not a managed application.

There are examples about in C or C++. I have heard of folks doing it in Delphi. but C#? Seems very unlikely to me.

As a hint, FS Gauge files (when programmed in C/C++) are DLL's in all but name. I've no idea about these new-fangled XML ones though. For FS9 and before, the only real difference between a loadable DLL in the modules folder and a GAU file loaded via a PANEL.CFG declaration is its name and position. The rest is mere detail. Those of us that have written DLLs have started from that viewpoint.

FSX is different. You need the FSX SDK. Check the SimConnect SDK section.

Regards

Pete

Link to comment
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
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.