Force window size and position

I have the following script...

\^!r:: ; This hotkey is Ctrl + Alt + r WinMove,A,,0,0,1920,1080

This seems inconsistent depending on the application I use it against. For some windows, it fits the screen nicely and goes right to the top-left of my monitor. Others have an approximate 10-pixel margin around the window.

Is there any way to do this consistently? It doesn't matter if the script becomes more complex.

I've currently done this, but it's very hacky. I'd ideally like the script to work out this dynamically rather than hardcoding process names...

``` !r:: ; This hotkey is Ctrl + Alt + r

WinGet, activeProcess, ProcessName, A ;MsgBox % "The active window's class is: " activeProcess

if (activeProcess == "rider64.exe" || activeProcess == "WindowsTerminal.exe" || activeProcess == "chrome.exe") { WinMove,A,,-10,-5,1940,1090 } else { WinMove,A,,0,0,1920,1080 } ```