I'm going to have to call this an edge case rather than a bug unless there are more examples in various applications that I can get information about. I encourage you to keep trying different combinations of actions to try to get the desired effect.
Oh my, I didn't want you to start doubting your whole codebase.
Please forgive if I didn't give enough context, leading you on a wild-goose chase.
Prepar3D is just a version of good ole (32-bit) Microsoft Flight Simulator. FlyInside is a 3rd party tool that uses a modified DLL to grab P3D's DirectX rendering and turn it into an immersive VR experience for Oculus Rift and HTC Vive and it provides some nifty quality-of-life features like grabbing windows from the desktop and displaying them inside the cockpit as floating windows (so pilots can see P3D dialogs, but also something like a browser window with airport information while in VR).
FlyInside lets P3D render its "normal" main window on the desktop (P3D can't run fullscreen in this setup), and that's the window that usually has the focus and receives all the input. There is no separate FlyInside application or "control" window, all interaction with FlyInside itself happens in VR.
The good news:
I've used P3D with FlyInside in combination with VoiceAttack for a few months now without any issues whatsoever.
I often have a handful "undocked" P3D dialog windows open (each of them is a normal desktop window belonging to the P3D process), in addition to other windows I use inside the cockpit, and I switch between them all the time, either on the desktop or inside the cockpit, and I've never had any issue with VA commands not working in P3D because of other windows, or focus issues, or task switching.
And here end the good news.
I recently started recording and streaming sessions, and that's when I began to use the "mirror window" feature of FlyInside. FlyInside projects what I see inside the Rift to an extra window (I put that window on that part of my "extended" desktop that I grab with a capture card). Since this window is created by code in the "injected" DLL, it's still inside P3D's "context" (or whatever the correct technical term might be). This window does not accept input, when I hover the mouse over it, the mouse pointer turns into an "entry forbidden" sign. And only when this window appears, the main P3D window (often) appears to become "invisible" to VA.
I don't know enough about Windows internals to even begin to speculate how the Mirror window is different from "normal" windows that VA encounters (and has no problems with), but I noticed that it's the only extra window that appears in the Task Manager in addition to the main P3D window -- unlike the undocked dialog windows I mentioned before (like the ATC in this example):
https://drive.google.com/file/d/0B7Z-8ZNJtXTPWkUtTTBFeTVJWFk/viewWhen I set VA to send commands only to the "Lockheed Martin..." window, it's as if it tosses a coin when it first encounters the second window and decides whether it will still remember the first window whenever there are two to choose from.
When I start VA before I start P3D/FlyInside (which is my usual procedure), chances are very high that I will see the "Error acquiring process handle" message. When I start VA after I launched P3D/FlyInside and opened the mirror window, chances are higher that VA will send commands to the correct window without complaining, and I think this persists for the whole "session" (ie. until I restart VA and/or P3D), no matter how often I toggle the mirror window off and on subsequently.
So, I guess what I'm saying is, could there be an issue that only affects applications that open multiple application windows?
Possible test case(?): If the window list in the "Send commands to:" dropdown is "authoritative" for what VA sees or accepts as targets, and I use the "New Window" or "New Incognito Window" function of Chrome, should I be able to see all the different Chrome windows in that list after using the "refresh" option? Because I don't. What I see seems a bit inconsistent:
- when one Chome window is open, its title will always be in the dropdown, obviously
- when two Chrome windows are open, (almost?) always only the window that last had the focus will be in the list
- when three Chrome windows are open, the list will very often contain one, sometimes two (!) of the window titles, never all three of them
All the Chrome windows had different tabs open, so they had different names. Is this working as intended? If not, could it be related to my issue? If yes, could it still be related to my issue?