FuPeiJiang / VD.ahk

Windows Virtual Desktop, AutoHotkey, Windows 11 support, Windows Server 2022, switch desktop, move window(wintitle) to current desktop; createDesktop, PinWindow, getCount, getDesktopNumOfWindow -> mute all windows in Virtual Desktop
MIT License
319 stars 45 forks source link

VD.ah2: check WinExist before WinGetMinMax #29

Closed StalkR closed 1 year ago

StalkR commented 1 year ago

On Windows 11, I'm getting some errors on WinGetMinMax that window doesn't exist, I think because we still get the hwnd from the old desktop which doesn't exist on the new desktop, maybe some form of race condition.

Adding the check for WinExist avoids the error, and it works as expected with the window under activated.

Thanks for the script/library!

FuPeiJiang commented 1 year ago

I was using v1 to v2 converter,

https://github.com/FuPeiJiang/ahk_to_v2.ah2/commit/31dc951759c4439e039f1311f2931c2aef0795d8, now fixed

it was incorrect to translate DetectHiddenWindows, off to DetectHiddenWindows "off" because in v2 that's equivalent to DetectHiddenWindows true, which is the opposite of what you want