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 = @"
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

Join the conversation


Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.


×   Your previous content has been restored.   Clear editor



  • Create New...