Skip to content

Commit

Permalink
Hide the window, not just send to back
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesSwift authored Mar 4, 2023
1 parent 7cd2c65 commit 2c7f9e4
Showing 1 changed file with 30 additions and 15 deletions.
45 changes: 30 additions & 15 deletions autohotkey-zoom-wrangler.ahk
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
#Requires AutoHotkey v2.0

; AutoHotKey-Zoom-Wrangler
; Version 0.0.1
; Created by James Swift
; https://github.com/JamesSwift/AutoHotKey-Zoom-Wrangler


; Which monitor should zoom be displayed on?
UseMonitor := 2



; Show zoom fullscreen on the monitor specified when the numpad1 key is pressed.
Numpad1::{
F9::{
if WinExist("Zoom ahk_class ZPContentViewWndClass", "", "Zoom Meeting"){

WinShow
WinActivate
WinMoveTop
WinGetPos &OutX, &OutY, &OutWidth, &OutHeight
Expand All @@ -20,14 +25,14 @@ Numpad1::{
MouseClick "Left", Round( OutX + (OutWidth / 2) ), Round(OutY + (OutHeight / 2)), 2
MouseMove StartX, StartY
}

}
}

; Move zoom behind other applications when numpad2 is pressed
Numpad2::{
F10::{
if WinExist("Zoom ahk_class ZPContentViewWndClass", "", "Zoom Meeting"){
WinMoveBottom
WinHide
}
}

Expand All @@ -37,23 +42,33 @@ Numpad2::{
; Confirm the specified monitor exists
try
{
DetectHiddenWindows 1
MonitorGet UseMonitor, &ML, &MT, &MR, &MB
MW := MR - ML
MH := MB - MT

; If the window isn't on the correct monitor, make it so
WinWait("Zoom ahk_class ZPContentViewWndClass", "", , "Zoom Meeting")
Sleep 5000
if WinExist("Zoom ahk_class ZPContentViewWndClass", "", "Zoom Meeting"){
WinMoveBottom
WinGetPos &OutX, &OutY, &OutWidth, &OutHeight
if ( OutX + OutWidth > MR || OutX < ML || OutY + OutHeight > MB || OutY < MT ){
WinMove (ML + 50), (MB - 300 - 50), 300, 300
WinMaximize
WinMoveBottom
}
WinHide
}
}
catch
MsgBox "Monitor " UseMonitor " doesn't exist. Check the Auto Hot Key config file."


; If the window isn't on the correct monitor, make it so
WinWait("Zoom ahk_class ZPContentViewWndClass", "", , "Zoom Meeting")
Sleep 5000
if WinExist("Zoom ahk_class ZPContentViewWndClass", "", "Zoom Meeting"){
WinMoveBottom
WinGetPos &OutX, &OutY, &OutWidth, &OutHeight
if ( OutX + OutWidth > MR || OutX < ML || OutY + OutHeight > MB || OutY < MT ){
WinMove (ML + 50), (MB - 300 - 50), 300, 300
WinMaximize
WinMoveBottom
OnExit ExitFunc
Persistent
ExitFunc(ExitReason, ExitCode){
if WinExist("Zoom ahk_class ZPContentViewWndClass", "", "Zoom Meeting"){
WinShow
}
}

0 comments on commit 2c7f9e4

Please sign in to comment.