- Messages
- 87
- Country

I have found a solution, not perfect by the way.
I guess that P3D (FSX) uses DirectSound (dsound.dll) primary buffer. I have tried to add DirectSound to the Pop-Up window and do some Cooperative, but I don't know what settings P3D (FSX) uses. If sim have used DSBCAPS_GLOBALFOCUS may be it will be possible. So when P3D window is in background or loose focus the sim sound is muted.
Let's try to display our window on top of sim and give back focus to the sim window.
1. Take the handle to the main window of P3D (FSX)
2. After processing your window messages (user input for example) put sim window to the foreground. If you done this fast enough the sound will not be interrupted.
Buttons and timers works fine, but for textbox input you will need some hack.
I guess that P3D (FSX) uses DirectSound (dsound.dll) primary buffer. I have tried to add DirectSound to the Pop-Up window and do some Cooperative, but I don't know what settings P3D (FSX) uses. If sim have used DSBCAPS_GLOBALFOCUS may be it will be possible. So when P3D window is in background or loose focus the sim sound is muted.
Let's try to display our window on top of sim and give back focus to the sim window.
1. Take the handle to the main window of P3D (FSX)
C++:
HWND P3DMainWindow = FindWindow(L"FS98MAIN", NULL); // Get P3D main window handle (there is only one window with FS98MAIN window class inside the process)
C++:
SetForegroundWindow(P3DMainWindow);
