
Unfortunatly there are some scenarios where Windows can't tell the difference between legitimate user actions that should change the foreground and unwanted foreground-theft. In theory apps shouldn't be able to steal the foreground while you're actively using another app. No, there isn't an easy way to add this behavior, but Windows tries to do this automatically. I do know AHK and if it's possible with that, that'd be great.


The question is: Is there an easy way to tweak Windows to make this happen? I know very little about Windows programming. If and when you press the key combo, it switches to the window. We show something like a toaster message saying "Foobar installer wants focus, press Win-Whatever to switch to it". How my ideal solution to this problem would work: Every time a window tries to steal focus, we intercept that, and don't let it. This is doubly annoying to me because I'm using a multiple-desktop program called DexPot, and when a window steals focus, it also brings itself to the desktop I'm currently on, which can be really annoying, because then I have to put it back into its original desktop. Now I'm in the middle of writing an email, so I might press a key that happens to be bound to a button on that installer, and then that button gets invoked, doing some action that I never intended to happen! Then suddenly the installer finishes and its window steals the focus. While it's working, I'll switch to my browser and browse, maybe entering some text into an email in my browser. For example, I could be running an installer for some program.
:max_bytes(150000):strip_icc()/GettyImages-760156259-5b7ebdc8c9e77c004fe34e05.jpg)
The thing that annoys me is when windows steal focus. Yesterday I thought about something that has always annoyed me in Windows and that I've taken for granted, and I realized that I have a better idea for how it could work, and I'm now wondering whether it's possible to tweak Windows to work like that. I'm a developer and a long-time Windows user with an obsession about making my system as convenient to use as possible.
