Jump to content

PowerShell script to activate Windows 10 window on mouse-over


Recommended Posts

This PowerShell script (once executed) activates a Windows 10 window on mouse-over. Maybe someone finds it useful. Admittedly, you get the same without the script by left-clicking on the desired window. Anyway, there might be Windows users who like this experience known from several Linux distros. ;)

$signature = @"
[DllImport("user32.dll")]
public static extern bool SystemParametersInfo(int uAction, int uParam, ref 
int lpvParam, int flags );
"@

$systemParamInfo = Add-Type -memberDefinition  $signature -Name SloppyFocusMouse -passThru

[Int32]$newVal = 1
$systemParamInfo::SystemParametersInfo(0x1001, 0, [REF]$newVal, 2)

Cheers! :)

PS: It's not my code - I found it somewhere, so credits go to its (to me anonymous) author.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...