This (Windows employing different methods to prevent users from writing programs that programmatically change application focus) has been an ongoing struggle for me for the better part of 3 years.
I finally made what feels like some significant progress this past week.
If you’ve ever obsessively gone deep down into a hole trying to understand and wrangle weird OS-level behaviors before, you might enjoy this video and feel a vicarious sense of victory :)
Well, here’s hoping you land on your feet!