Give this a try. I made some changes to the code, changed the dynamic hotkeys to regular ones (the ones using the Hotkey command), removed braces in the ResizeOn and ResizeOff labels (they're only necessary for functions), and replaced the IfWinExist commands with checking ErrorLevel, it will be 0 if the window comes into existence, 1 if it does not, and I added a 5 second timeout to it so it doesn't wait indefinitely.
Code:
LWin & RCtrl::
GoSub, ResizeOn
return
LWin & LCtrl::
GoSub, ResizeOff
return
ResizeOn:
WinWait, ahk_class GHOST_WindowClass,, 5
If (ErrorLevel = 0)
{
WinMove, , , 0, 0, 2048, 768 ; move the window to 0,0 and reize it to 2048x768
WinSet, Style, -0xC00000 ; remove the titlebar and border(s)
}
return
ResizeOff:
WinWait, ahk_class GHOST_WindowClass,, 5
If (ErrorLevel = 0)
{
WinMove, , , 0, 0, 1024, 768 ; move the window to 0,0 and reize it to 1024x768
WinSet, Style, +0xC00000 ; Adds the titlebar and border(s)
}
return
#NoTrayIcon