Closed pidgeon777 closed 5 years ago
There isn't an function setup to do it but you can utilise the VirtualDeskopManagerClass
and DesktopMapperClass
to do it. Here is an example
hwnd := WinExist("ahk_exe notepad.exe")
vDManager := new VirtualDesktopManagerClass()
virtualDesktopGuid := vDManager.getDesktopGuid(hwnd)
dManager := new DesktopMapperClass("ignore this")
dManager.mapVirtualDesktops()
virtualDesktopId := dManager._idFromGuid(virtualDesktopGuid)
virtualDesktopNumber := dManager._indexOfId(virtualDesktopId)
msgbox % "hwnd: " hwnd "`ndesktop guid: " virtualDesktopGuid "`ndesktop id: " virtualDesktopId "`ndesktop number: " virtualDesktopNumber
Hello, first of all, thanks for your script. I would like to ask if it could be possible with your library to detect the index of the Virtual Desktop hosting a certain window identified through WinTitle (for example, by providing its
ahk_id
, orahk_exe
, etc.).Thank you