• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

simconnect gui focus

Messages
13
Country
us-california
Hello all

Here goes my first post.

I've written a gui that has some text boxes that display some info from flight sim. I also have some buttons that allow you to change what info you want to look at. I have half the gui, and half flight sim on the same screen.

My problem is, whenever I click on my gui, flight sim loses focus and the sound goes away. I want to flight sim to always keep its focus. So here's what I tried so far.

I've seen other programs run with flight sim and not take the focus away. One of these programs being a simulated garmin. It had a garmin.dll and a garmin.exe. The garmin window would run with fs and not steal focus.

So I was thinking I could make a dll to run with fs. This part is easy. The first problem I ran into is that I don't think I can convert my gui to a dll because a dll is only a library??? So I tried running the executable from the dll with a system("mygui.exe");

Ok, 2 problems here. First, mygui runs, but clicking on it still steals focus. Second, fs will hang until I exit mygui.

So, I added AfxBeginThread(mythread). Mythread contains the system("mygui.exe") call. Exact same problems as before.

So I commented the sytem(). Then added:

for (int i=0;i<1000000;i++)
{
if ( (i%10000) == 0)
printf("something"); // prints to simconnect diagnostic window
}

FS runs while this for loop is happening.

I haven't tried it yet, but this makes me think that calling system("notepad") from a flight sim menu may have the same behavior. Maybe, maybe not. I guess we'll just have to see.

Any ideas?

Thanks
 
I took the sample menu simconnect program from the sdk. Added a system("mygui.exe") on EVENT_MENU_ONE, and its stole the focus. I'm running out of ideas here.
 
Back
Top