Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
powershell (Add-Type '[DllImport(\"user32.dll\")]^public static extern int PostMessage(int hWnd, int hMsg, int wParam, int lParam);' -Name a -Pas)::PostMessage(-1,0x0112,0xF170,2)
Copy link

EugeneLoy commented Oct 20, 2021

@Ma-XX-oN Thanks. I've updated the gist with your code.

Copy link

IVIJL commented Nov 9, 2021

is there a way to tell it to which of the multimonitor setup to turn off ?

Copy link

Ma-XX-oN commented Nov 13, 2021

Not that I'm aware of. AFAIK, it just turns off all of them.

Copy link

wilsonephillips commented Apr 22, 2022

Very nice. I dropped it into my scripts folder and placed a shortcut on my desktop. I already had something similar on Linux and I am glad to see someone already did this for Windows.

Copy link

huydhoang commented May 11, 2022

Great script! Just a note, .NET 3.5 is required on Windows 11 for this to function. Otherwise you'd get mscoree.dll error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment