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
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
