Last active
May 17, 2020 04:46
-
-
Save ChrisPritchard/a87178329f6e13e483d681de461ccf18 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# small powershell script that will move a window to a specified location. | |
# used (as can be seen in the code) to move a borderless 1920x1080 Skyrim SE window to the middle of my 3840x1080 screen. | |
add-type @" | |
using System; | |
using System.Runtime.InteropServices; | |
namespace WindowMethods { | |
public class Imported { | |
[DllImport("user32.dll")] | |
public static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, uint uFlags); | |
} | |
} | |
"@ | |
# args are: window handle, what to put it behind (0 = nothing), x pos, y pos, br x (ignored), br y (ignored), flags (1 = don't resize) | |
[WindowMethods.Imported]::SetWindowPos( (Get-Process -Name SkyrimSE).MainWindowHandle, 0, 960, 0, 0, 0, 0x0001 ) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment