Share via


Prevent Focus Stealing

Question

Thursday, November 2, 2017 3:40 PM

Focus stealing is incredibly annoying at times. This is not the first thread to point that out, so I won't go on and on. I feel like Win95 had an option to “Prevent focus stealing” but perhaps that was some “PRO PowerUltraMegaConfig” type of thing I installed as teenagers do. I read the previous thread entitled "Windows 10 : Stop any application from stealing focus ever. Is it possible?". It has now been closed but no real solution was offered, just excuses as to why it would be too hard/impossible.

I was wondering if this approach might work or if not why not....

  • Separate the idea of which process has focus and which window has focus, these are different things. This would be just like how each control within a window has focus, but as window focus takes precedence over control focus, so process focus should have higher precedence still. 
  • If a process gives one of its windows focus, the window gets the focus within that process, but that doesn't affect which process/app has focus.
  • When a user launches an app/process in a normal way, e.g. clicks a shortcut, uses the run command etc. that process gets focus immediately.
  • No other process should ever get focus until the user grants it.
  • An app can programmatically yield to another if it wants (I imagine this is already possible). So, developers of processes which launch other processes can handle focus switching if they don't like the default behaviour. 

 

In my head that should work. If the user launches a process which pops its window up quickly, they won't have clicked on anything else yet and the new window gets focus because it's process has focus. If they launch a process that takes a while to load, the user will have time to change process focus and the new process's window will load in the background without stealing focus. Or if they go and make coffee while the process is loading, and don't change process focus, the newly launched app will get focus. Everybody wins maybe?

All replies (2)

Friday, November 3, 2017 2:03 AM

On Windows side, we usually modify registry to deal with focus stealing issue.

In Regedit (Start button+R, then type regedit),

Navigate to HKEY_CURRENT_USER\Control Panel\Desktop\ForegroundLockTimeout

Make sure the value is 30d40 and the Base option is set to Hexadecimal

About the viewpoint in the last paragraph, I agree with you, try to feedback this idea to Microsoft via Feedback Hub

>>if they go and make coffee while the process is loading, and don't change process focus, the newly launched app will get focus

Besides, A good discussion about Preventing applications from stealing focus

https://superuser.com/questions/18383/preventing-applications-from-stealing-focus

Please Note: Since the website is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.

Regards

Please remember to mark the replies as answers if they help.
If you have feedback for TechNet Subscriber Support, contact [email protected].


Tuesday, November 28, 2017 9:03 AM

We have not heard from you in a couple of days. Please post back at your convenience if we can assist further.

Please remember to mark the replies as answers if they help.
If you have feedback for TechNet Subscriber Support, contact [email protected].