Last active
November 27, 2025 21:09
-
-
Save technoscavenger/1395761f33721dd37be86c83a5925816 to your computer and use it in GitHub Desktop.
Get geometry for VNC session
This file contains hidden or 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
| Add-Type -AssemblyName System.Windows.Forms; | |
| $wa = [System.Windows.Forms.Screen]::PrimaryScreen.WorkingArea | |
| $titleBarHeight = [System.Windows.Forms.SystemInformation]::CaptionHeight | |
| #$offset = 16 #VNC | |
| $offset = 0 #RPD | |
| $w = $wa.Height - $titleBarHeight - $offset | |
| $h = $wa.Width - $offset | |
| Write-Host "$($h)x$($w)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment