Win 7 - Lock window focus?

noquarter

Gawd
Joined
Jan 7, 2010
Messages
606
Anyone know a way to force Windows to maintain focus on an app? I tried DeskPins which lets you pin an app to top level but it can still lose focus. I want the app to never lose focus if possible.
 
Anyone know a way to force Windows to maintain focus on an app? I tried DeskPins which lets you pin an app to top level but it can still lose focus. I want the app to never lose focus if possible.

You don't want the app to lose focus? So you want it to take over the who system? What exactly are you trying to achieve?
 
You don't want the app to lose focus? So you want it to take over the who system? What exactly are you trying to achieve?

Well.. I know it's a frivolous endeavor but..

I want to be able to maintain as much focus on the windowed game I'm playing in one window while I click links on the browser on the 2nd monitor. I figured if the game window had focus locked it may still process the clicks in the browser window even though that window never gains focus.


I've figured out a method to do this actually.. made this quick script:

Set WshShell = WScript.CreateObject("WScript.Shell")
i=1
Do
WshShell.AppActivate("The Lord of the Rings Online")
WScript.Sleep(130)
i = i + 1
Loop Until i = 200


I needed the delay to be around 120-130 milliseconds, maybe even a little bit more, for the browser to have long enough to register the click before focus switches back to the game. Also had to edit the registry to turn off the foreground focus lockout.

It's pretty close to what I want, would be nice if it could push through the click without ever losing focus for more than 20ms, but the main thing I need now is a way to activate/deactivate it. Just have a counter in there for testing atm.
 
Last edited:
Back
Top