lunixbochs
lunixbochs

Reputation: 22415

How can I prevent focus stealing in Windows?

A quick Google search for solutions to Focus Stealing in Windows reveals two main result categories:

It's particularly annoying in two common scenarios:

What creative solutions can be applied to fix this problem for either or both of these scenarios?

Upvotes: 18

Views: 3763

Answers (1)

Cecil Dishwasher
Cecil Dishwasher

Reputation: 374

I have one suggestion for how it can be solved, but I cannot implement it completely since I lack the knowledge.

The focus change between windows have to be instigated by the offending program calling a Windows API function located most probably in shell32 or user32. Some progams, like Adobe Photoshop makes the call multiple times (at least twice) to force itself up on the user when it's starting. The idea is to hook into this API function (if possible) and check where the call originates from. If it's not from explorer.exe (i.e. Alt+Tabbing or clicking an icon on the taskbar), then call should be blocked by said hook.

Upvotes: 2

Related Questions