I hate because windows have no option to disable "stealing focus" if I load another application... Lets say, If i'm in Firefox and I run an application with a hotkey, I want that application run in the background, not stealing focus (Adobe apps are the worst into this)... I tried everything, registry, GPO, some ahk scripts... Nothing it is working...
For this, I am trying to make a script, which will make the active window OnTop and changes the title to "Active - Title...", If I change the focus to another application, old active (no more active) window should be renamed back as the original title and become not OnTop, but loop for new window active...and so on... This is what I have done till now, but it is not working... Any help?
Code: Select all
#Persistent
SetTitleMatchMode, 1
SetTimer, action, 1000
Return
action:
WinGetTitle, ActiveTitle, A
If !winactive(OldWindow)
{
NewName_OldWindow := StrReplace(OldWindow, "Active - ")
WinSetTitle, %OldWindow%, , %NewName_OldWindow%
Winset, AlwaysOnTop, Off, %NewName_OldWindow%
}
if (winactive(ActiveTitle) & !winactive("Active -"))
{
OldWindow = %ActiveTitle%
WinSetTitle, %ActiveTitle%, , Active - %ActiveTitle%
Winset, AlwaysOnTop, On, %ActiveTitle%
}
Return