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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...