Fix for Windows 11 22H2
IVirtualDesktopManagerInternal.GetDesktops() doesn't work on Windows 11 22H2. So I instead switched to use the registry to get a list of virtual desktop IDs.
See https://github.com/zgdump/windows-virtualdesktopindicator/issues/18
Note, I haven't programmed in C# for several years, so I'm a little rusty. Feel free to clean the code up if the logic makes sense.
@zgdump
Hello, @renns! You've fixed an important bug. Could you build a release for me with the bug fixed. Until the author has processed your pull request. Thanks a lot!
@dfateev-git , I don't currently have the tooling installed anymore to build this. Also, although I fixed the immediate bug, I still had issues where the app would crash silently after a few minutes.
Another user suggested using a similar app here: https://github.com/dankrusi/WindowsVirtualDesktopHelper
I have switched to using WindowsVirtualDesktopHelper and it works no problems with Windows 11, plus also has additional features. I'd suggest switching to use that instead.