VirtualDesktop: Broken in 22621?
It seems that the tool is broken again in Win11 on 10.0.22621 Build 22621.
I am getting this error (with the VirtualDesktopInsider version, but I tried all, none works):
VirtualDesktopInsider.exe -GetCurrentDesktop -Calc:+1 -MoveWindowHandle: 1775152
Unhandled Exception: System.TypeInitializationException: The type initializer for 'VirtualDesktop.DesktopManager' threw an exception. ---> System.InvalidCastException: Specified cast is not valid.
at VirtualDesktop.IServiceProvider10.QueryService(Guid& service, Guid& riid)
at VirtualDesktop.DesktopManager..cctor()
--- End of inner exception stack trace ---
at VirtualDesktop.Desktop.get_Current()
at VDeskTool.Program.Main(String[] args)
About this issue
- Original URL
- State: closed
- Created 10 months ago
- Reactions: 1
- Comments: 22 (8 by maintainers)
Hello @slnz00,
thank you for your very valuable information and the great script slnz00/VirtualDesktopDumper
I will integrate the won informations soon.
Greetings
Markus
Hey,
Inspired by @NyaMisty’s solution (GetVirtualDesktopAPI_DIA), I created a dumper that works with the latest versions of Windows 11:
slnz00/VirtualDesktopDumper
I set up some virtual machines and created dumps for all the current live releases (including the insider versions). You can find these dumps in the dumper’s repository.
I also tested your latest 23H2 release (v1.15), and it works great for all versions after
22621.2215, except for the current canary build (25941.1000) where they reintroduced theSwitchDesktopAndMoveForegroundViewfunction which was previously removed and caused issues in22621.2215.A new
IVirtualDesktopinterface GUID has also been introduced. It can be extracted using theIID_IVirtualDesktop2symbol. However, it seems that using the old GUID still works and does not cause any issues.Released a new version of VirtualDesktop today.
VirtualDesktop11-23H2.cs is intended to work with Windows 11 22H2 beginning with release 2215 and with the Insider versions of Windows 11.
As I do not have a test environment, this is associated with certain uncertainties…
Greetings
Markus
This seems to work for the latest Windows versions:
However, there is still 1 problem: the CurrentVirtualDesktopChanged notification never happens!
ViewVirtualDesktopChanged arrives correctly, but CurrentVirtualDesktopChanged does not. What could be the reason?
Regards!