In Windows 10 you can create multiple desktops and switch between them. I want to run a python3 code when I am on a certain desktop. How do I detect which desktop I'm on?
Download the VirtualDesktopAccessor.dll from here and put it in your working directory.
Run the following code:
import ctypes
vda = ctypes.WinDLL("VirtualDesktopAccessor.dll")
num = vda.GetCurrentDesktopNumber()
print(num)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.