Skip to content

Instantly share code, notes, and snippets.

@fabd
Created January 30, 2019 13:30
Show Gist options
  • Save fabd/967fe59c52587b0fa4121dcec9f5fd47 to your computer and use it in GitHub Desktop.
Save fabd/967fe59c52587b0fa4121dcec9f5fd47 to your computer and use it in GitHub Desktop.
Simple script to maximize the desktop area of VMware remote console, with the Windows 10 Taskbar docked to the side.
;
; VMRC "Maximizer"
;
; Simple procedure to maximize VMRC's desktop area, while keeping the Windows 10
; taskbar docked to the side. Remove the VMRC window titlebar, and the toolbar.
;
; SETUP
;
; - Set Windows Taskbar docked to the right
;
; - Make sure VMRC window is not fullscreen AND not maximized
;
; - Hide VMRC's toolbar (it doesn't autohide unless fullscreen).
;
; Edit "%APPDATA%\VMware\preferences.ini", add this line:
;
; vmplayer.showChrome = "FALSE"
;
;
; USAGE
;
; Launch this script once after the VMRC console is open.
;
;
; Units:
; win 10 taskbar docked right 62px wide
; vnrc titlebar maximized 23px high
;
; laptop 1920px - 62px = 1858 px
; 1080
; Keep the script running until the user exits it.
#Persistent
#SingleInstance force
; Creates a separator line.
;Menu, Tray, NoStandard
;Menu, Tray, Add, Maximize VNRC, RemoveTitleBar
;Menu, Tray, Add, Resotre VNRC, RestoreTitleBar
;Menu, Tray, Add, Exit, ExitAHK
Sleep, 3000
Gosub RemoveTitleBar
ExitApp
Return
; don't mess other windows
#IfWinActive ahk_class VMPlayerFrame
RemoveTitleBar:
ActivateWindow()
WinGet Style, Style, A
;if (Style & 0xC40000) {
WinGetPos, X, Y, Width, Height, A
WinSet, Style, -0xC40000, A
WinMove,A,,0,0,1858,1080
return
RestoreTitleBar:
ActivateWindow()
WinGet Style, Style, A
WinSet, Style, +0xC40000, A
WinMove,A,,%X%,%Y%,%Width%,%Height%
return
ActivateWindow()
{
if WinExist("ahk_class VMPlayerFrame") {
WinActivate ; Uses the last found window.
}
}
ExitAHK()
{
ExitApp
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment