pmb6tz / windows-desktop-switcher

An AutoHotKey script for Windows that lets a user change virtual desktops by pressing CapsLock + <num>.
MIT License
1.23k stars 230 forks source link

Toggle Show window/app on all desktops #73

Open marium0505 opened 3 years ago

marium0505 commented 3 years ago

Hey,

Can you look into how to toggle "Show this window on all desktops" and "Show windows from this app on all desktops"? I tried the code here but looks like it is outdated.

FuPeiJiang commented 2 years ago

@marium0505 another repo: VD.ahk example:

#Include path\to\VD.ahk

VD.PinWindow("ahk_exe explorer.exe")
Numpad0::VD.TogglePinWindow("A") ;active window

this is a class, #include it https://github.com/FuPeiJiang/VD.ahk/blob/class_VD/VD.ahk


; "Show this window on all desktops"
; VD.IsWindowPinned(wintitle)
; VD.TogglePinWindow(wintitle)
; VD.PinWindow(wintitle)
; VD.UnPinWindow(wintitle)

; "Show windows from this app on all desktops"
; VD.IsAppPinned(wintitle)
; VD.TogglePinApp(wintitle)
; VD.PinApp(wintitle)
; VD.UnPinApp(wintitle)

https://github.com/FuPeiJiang/VD.ahk/blob/e74cfaa4a15a044a0ba58106b26b5927364947df/VD.ahk#L17-L27

I removed "Show windows from this app on all desktops" because I didn't think anyone would use it, I personally would only use "Show this window on all desktops" tell me if you are going to use it, and use case? I'm curious