I have a serious problem on my work machine with a third
party software window stealing keyboard focus, using a winapi
monitor tool i detect that whenever the windows steal focus it first call SetForegroundWindow.
While searching about, i have found the winapi
LockSetForegroundWindow, wow i thought i had solved the problem, however, LockSetForegroundWindow
blocks me from activating any other window.
I also found that would be possible to 'block' the window from calling SetForegroundWindow
using a hook
, but i have no knowledge about hooking, would like to ask if there's something else i could try.
Usually calling
SetForegroundWindow()
isn't bad. Since Windows XP, there is a lock that no program do this without being allowed to do this. Read the docs: https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setforegroundwindowThis are the exceptions:
But when the third party tools uses
AttachThreadInput()
, it bypasses all these checks.Just delete this "bad" software. Contact the developers.