FSX:SE Pop up window

#1
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
 
#2
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
 
#4
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
 
#5
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.
 
#6
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...
 
#7
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
 
#8
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
 
#11
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.
 
#12
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
 
Top