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

FSX:SE Pop up window

Messages
531
Country
france
Hello experts,

I am working on an utility add-on development I started long ago with FS2004. The goal is to have have an FS Nav-like window that can pop up during the flight to help you in getting information on the area, airports, ILS, navaids, etc... For those who don't know FS Navigator, it was a very complete navigation tool that was embedded in FS2004 so you could see the map without even pausing the sim.
I liked that and I was trying to do the same. In FS2004, it was working perfect. I press a key and the window pops up while letting me see behind the sim is still flying, no pause. In FSX (SE) it worked almost the same, except the sim image was frozen even though it wasn't paused. Not as good, but still acceptable, and it was working in windowed and full screen mode.

The problem I have now is that it works only in windowed mode. If I try to pop up the window while in full screen mode, I see an error on the debugger:

Code:
[12128] DXGI Error 00190e1e: (10484@473817843) at 6B124CEB - Occluder wnd ('Code' is HWND):FSMAPWINDOW
[12128] DXGI Error 087a0001: (10484@473817812) at 6B15CF78 - Non-zero return value
[12128] DXGI Error 087a0001: (10484@473817812) at 6B12F220 - Non-zero return value
[12128] DXGI Error 087a0001: (10484@473817812) at 6B12EADA - Non-zero return value
[12128] DXGI Error 087a0001: (10484@473817812) at 6B124D45 - Non-zero return value

FSMAPWINDOW is the name of the window I try to popup.
This error is repeated hundreds of times...
Any idea how to fix this?

I can share the code I use to create my pop up window, if needed.

Thanks,
Eric
 
Messages
531
Country
france
Just in case my previous post is too long or complex, the simple question is:
In a module that is loaded when FSX starts, is it possible to create a window using the CreateWindow function that pops up on the screen when FSX is in full screen mode?

I am sure I had it working some months ago, but it doesn't work anymore while I don't think I changed anything on my system. Maybe some Windows update changed something in the graphic drivers or in DX?

Eric
 
Messages
531
Country
france
Thanks for the info.
I tried using CreateWindowEx instead of CreateWindow but it doesn't work any better, maybe because I don't use the right parameters:

Code:
fsMapWindow = CreateWindowEx(WS_EX_WINDOWEDGE, className, "FSMap", WS_POPUPWINDOW, windowPos->left, windowPos->top, windowPos->right - windowPos->left, windowPos->bottom - windowPos->top, hFSimWindow, NULL, hinst, NULL);

I am frustrated because I am sure it was working in the past, on FSX SE, and it doesn't work anymore while I didn't change anything in the code.

Eric
 
Messages
531
Country
france
I think that you can. I have used CreateWindowEx to answer on this topic for P3D.
You can try it in FSX (example with dll). It's just quick example, don't judge me.
I used the CreateWindowEx function with the exact same parameters as the ones you use in your GitHub project, but nothing works.
When FSX is in windowed mode, it is just perfect: the FSMap window pops up and the FSX animation does not stop, the simulation runs perfect in the FSX window and my FSMap works in its own window.
In full screen mode, it just doesn't work: the FSX animation freezes and I still get the same DXGI error in the DebugViewer.
 
Messages
531
Country
france
I wanted to try to avoid using SimConnect because I wanted to have the same code for FS2004 and FSX, but I am afraid I can't escape SimSconnect on FSX for a pop up window...
 
Messages
531
Country
france
Just in case some of you are interested, I finally understand what is going on here :)
I could make my moving map module work again. Without changing anything in my code that doesn't use SimConnect, I could pop up my moving map window from FSX in full screen mode just by using CreateWindowEx. So I was not crazy, I remembered that used to work in FSX in full screen, my memory was not wrong. But this works only if DX10 Preview is not activated.
As soon as you activate DX10 Preview in the settings, it doesn't work anymore. And in that case I understand I have to use SimConnect_SetSystemState to set DialogMode, and say goodbye to the FS2004 compatibility. Anyway, who cares about FS2004 today?

Thanks to you all for your help anyway !!
Eric
 
Messages
531
Country
france
Just to keep you posted...
It now works perfect with SimConnect to set Dialog mode, the map window pops up like it should.
I just regret that the sound turns off because even though it is not visible on the screen, the aircraft keeps going when the map is popped up, I see it on the map because the aircraft is drawn on it. I can pause the sim when the map pops up (and unpause when it is closed) but I don't want to, I want to have something similar than FS Navigator, where the sim was still going (aircraft still flying, ATC still active) while the map was visible.
Do you know if this is possible? I don't think that running the pop-up window in a separate thread would do the trick... Any idea?

Thanks,
Eric
 
Messages
531
Country
france
Try with set WS_EX_NOACTIVATE to extended window styles parameter.
I just come back from vacations so I don't have a fresh memory, but I think I already tried this. When you use this parameter, the window is created but it is not active and as soon as you activate it with ShowWindow, the result is the same: the popup window has the focus and FSX sound is not heard anymore.
 
Messages
531
Country
france
Nevertheless, I wanted to give it a try, and I did it. The behavior is exactly the same when I use WS_EX_NOACTIVATE. In my code, I create the window using CreateWindowEx and the WS_EX_NOACTIVATE parameter, and later in the code I use ShowWindow(myWindowHandle, SW_SHOWNORMAL), so it makes no difference.
Whatever option I use, the FSX sound stops as soon as the FSX main window loses focus.

I am afraid I can do nothing against this, this is because of the way FSX uses DirectSound in its own code. The option MS chose is logical, you don't want to hear the sound of an app that runs in the background, but in some specific cases, it may be useful. I guess this is why Lockheed Martin added this option in P3D.

Do you think there is a chance I can modify the way FSX uses its DirectSound buffers? Even if it is hard-coded, does some DirectSound specialist change the parameters of a sound buffer that already exists?
The parameter that needs to be changed is the DBCAPS structure, in which the dwFlags shoudl be set to DSBCAPS_GLOBALFOCUS. I think it is not possible, but it is worth asking...

Thanks,
Eric
 
Messages
531
Country
france
Are you creating a child window? A dialog window?
I tried many different parameter combinations without any success...
I initially started with CreateWindow with this :

Code:
fsMapWindow = CreateWindow(className, "FSMap", WS_POPUP, windowPos->left, windowPos->top, windowPos->right, windowPos->bottom, hFSimWindow, NULL, hinst, NULL);

It works fine with the SimConnect_SetSystemState set to DialogMode, except the sond problem described above (the FSX sound is not heard anymore when the map window is active).
Following the advice in this thread, I switched to CreateWindowEx and made many tests with different settings, without being able to solve this sound problem. The latest try was this one:

Code:
fsMapWindow = CreateWindowEx(WS_EX_NOACTIVATE, className, "FSMap", WS_POPUPWINDOW, windowPos->left, windowPos->top, windowPos->right - windowPos->left, windowPos->bottom - windowPos->top, hFSimWindow, NULL, GetModuleHandle("FSMap.dll"), NULL);

In both cases, the result is the same: the map window appears, everything is correctly drawn in it, but the FSX sound is muted.
I must also say that later in the code, I show the window using this line:

Code:
ShowWindow(fsMapWindow, SW_SHOWNORMAL);

I would be glad if you could help me finding the right parameter combination to create my window, but I think it is impossible. I hope I am wrong, but what I understand is the FSX sound is muted as soon as the FSX main window loses focus. Whatever way I create my map window, it will necessarily make FSX main window lose focus.
What so you think?
 
Messages
2,077
Country
us-ohio
The ATC window is a window that pops up in the sim and it doesn't kill sound.
 
Messages
531
Country
france
That's right, but is it a "real" window?
I mean that it never gets the focus, it is half-transparent and the keyboard focus is still on the FSX main window. It is the FSX main window that capture the 1, 2, ... keys you press to chose an option in the ATC window and there is no mouse interaction. In the good old days of fs9, I had an add-on called fs9 Toolbox in which I used the fs9 semi-transparent window (also used by ATC) and I had to manage these key presses. It may be a problem because my map window needs to have the keyboard focus and mouse interaction.

Anyway, the question is not to know if the ATC is a real window or not, the question is: can we create a window that has a similar behavior with keyboard and mouse interactions?
I don't have the answer at this time...
 
Messages
531
Country
france
I didn't think about trying this, thanks for the suggestion. I have just tested and it doesn't work any better. I mean, the map window works but the FSX sound is muted, just like before, no change.
I used the combination of CreateWindowEx like this:

Code:
fsMapWindow = CreateWindowEx(WS_EX_NOACTIVATE, className, "FSMap", WS_POPUPWINDOW, windowPos->left, windowPos->top, windowPos->right - windowPos->left, windowPos->bottom - windowPos->top, hFSimWindow, NULL, GetModuleHandle("FSMap.dll"), NULL);

With ShowWindow like this:

Code:
ShowWindow(fsMapWindow, SW_SHOWNOACTIVATE);

Thanks for your help.
 
Messages
87
Country
russia
Anyway, the question is not to know if the ATC is a real window or not, the question is: can we create a window that has a similar behavior with keyboard and mouse interactions?
I don't have the answer at this time...
I have also tried not to mute sound from sim main window, but unsuccessful. I know that it possible. Look at the IVAO pilot client. Client's main window has focus for keyboard and mouse and doesn't mute sim sound. Default kneeboard window also doesn't mute sim sound.
 
Messages
531
Country
france
You're absolutely right. Even if I may think the ATC window is a "specific" window (I may be wrong about this), the IVAO client and the kneeboard are standard windows, so it must be possible.
Do you think that running the popup window in a separate thread could help?
I didn't try this but I don't think it is the solution...
Anyway, this makes me want to keep searching to find the solution to this problem.
 
Last edited:
Top