VD.ahk icon indicating copy to clipboard operation
VD.ahk copied to clipboard

"Error: (0x80004002) No such interface supported" after updating Windows 11 (Beta insider channel)

Open reidprichard opened this issue 1 year ago • 13 comments

After getting served KB5028256, VD.ah2 no longer works. Line 37 throws "Error: (0x80004002) No such interface supported". I'm afraid I don't have the technical knowledge to do much digging, but I'll do what I can if provided direction.

reidprichard avatar Jul 23 '23 22:07 reidprichard

I'm afraid I'm seeing the same issue: the latest update broke it 🤦 Regretting being on the Beta program so much right now 🤣

hamen avatar Jul 25 '23 12:07 hamen

Yeah, I figured I could live with a few bugs in the beta program but didn't expect it would break something so crucial to my workflow!

reidprichard avatar Jul 28 '23 14:07 reidprichard

Broken here too. Since this update will be live for standard users of Windows 11 soon, I'd love to have it fixed.

I'm using: https://github.com/FuPeiJiang/VD.ahk/blob/class_VD/_VD.ahk

JanChec avatar Aug 24 '23 05:08 JanChec

I imagine this explains why the window moving feature doesn't work anymore.

rushvora avatar Sep 05 '23 06:09 rushvora

Looks like VirtualDesktop.cs has been updated, and VirtualDesktop11-23H2.cs should work, see VirtualDesktop/issues/67. I'm not sure how to do this, though, can you point me in the right direction and I can try to do a PR to test this

bfarmilo avatar Sep 12 '23 14:09 bfarmilo

This is as far as I got. Providing as a diff rather than a pull request because I'm not really prepared to go further (and I never actually forked the repo):

diff --git a/VD.ah2 b/VD.ah2
index d90394e..6a78111 100644
--- a/VD.ah2
+++ b/VD.ah2
@@ -19,7 +19,7 @@ class VD {
       this._dll_CreateDesktop := this._dll_CreateDesktop_Win10
       this._dll_GetName := this._dll_GetName_Win10
       this.RegisterDesktopNotifications := this.RegisterDesktopNotifications_Win10
-    } else {
+    } else if (buildNumber < 22620) {
       IID_IVirtualDesktopManagerInternal_ := "{B2F925B9-5A0F-4D2E-9F4D-2B1507593C10}"
       IID_IVirtualDesktop_ := "{536D3495-B208-4CC9-AE26-DE8111275BF8}"
       this._dll_GetCurrentDesktop := this._dll_GetCurrentDesktop_Win11
@@ -27,6 +27,14 @@ class VD {
       this._dll_CreateDesktop := this._dll_CreateDesktop_Win11
       this._dll_GetName := this._dll_GetName_Win11
       this.RegisterDesktopNotifications := this.RegisterDesktopNotifications_Win11
+    } else {
+      IID_IVirtualDesktopManagerInternal_ := "{A3175F2D-239C-4BD2-8AA0-EEBA8B0B138E}"
+      IID_IVirtualDesktop_ := "{3F07F4BE-B107-441A-AF0F-39D82529072C}"
+      this._dll_GetCurrentDesktop := this._dll_GetCurrentDesktop_Win10
+      this._dll_GetDesktops := this._dll_GetDesktops_Win10
+      this._dll_CreateDesktop := this._dll_CreateDesktop_Win10
+      this._dll_GetName := this._dll_GetName_Win11
+      this.RegisterDesktopNotifications := this.RegisterDesktopNotifications_Win11
     }
     this.IVirtualDesktopManager := ComObject("{AA509086-5CA9-4C25-8F95-589D3C07B48A}", "{A5CD92FF-29BE-454C-8D04-D82879FB3F1B}")
     this.GetWindowDesktopId := this._vtable(this.IVirtualDesktopManager.Ptr, 4)
@@ -41,7 +49,7 @@ class VD {
       this.Ptr_CreateDesktop := this._vtable(this.IVirtualDesktopManagerInternal.Ptr, 10)
       this.Ptr_RemoveDesktop := this._vtable(this.IVirtualDesktopManagerInternal.Ptr, 11)
       this.FindDesktop := this._vtable(this.IVirtualDesktopManagerInternal.Ptr, 12)
-    } else if (buildNumber < 22489) {
+    } else if (buildNumber < 22489 or buildNumber >= 22621) {
       this.GetDesktops := this._vtable(this.IVirtualDesktopManagerInternal.Ptr, 7)
       this.Ptr_CreateDesktop := this._vtable(this.IVirtualDesktopManagerInternal.Ptr, 10)
       this.Ptr_RemoveDesktop := this._vtable(this.IVirtualDesktopManagerInternal.Ptr, 12)

My usage of VD.ahk is limited to exactly four methods: getNameFromDesktopNum, goToDesktopNum, MoveWindowToDesktopNum, and getCurrentDesktopNum. This works for those methods. I have absolutely no idea if any of the others work or not with this change and have no reasonable means of testing. But maybe it'll help.

Basically I started with "it looks like they changed a lot of the function params back to the way they had them in Win10" (based on staring very very hard at that VirtualDesktop.cs project code) and started trial-and-error switching to those instead.

Viqsi avatar Sep 28 '23 02:09 Viqsi

Updating another machine revealed that I was guessing the version numbers wrong. So I gave in and forked it. https://github.com/Viqsi/VD.ah2

Viqsi avatar Sep 29 '23 16:09 Viqsi

Seems to be working for me (Win11 10.0.22631), super appreciate the efforts!

reidprichard avatar Sep 29 '23 16:09 reidprichard

Seems to be working for me (Win11 10.0.22631), super appreciate the efforts!

It's not just the build number, it's the build revision as well; that's what makes this so annoying. 10.0.22631.2134 and earlier revisions are fine with the Old Ways, but 10.0.22631.2283 is not. I suspect the change happened with the preview release 10.0.22631.2215 (and that's what I checked for in the fork), but don't have actual confirmation of that as I don't do preview releases.

Viqsi avatar Sep 29 '23 16:09 Viqsi

Hmm, I did just see an update (in the Release Preview channel), so hopefully that doesn't complicate things. At any rate, I am on 10.22631.2361 now, and I believe VD stopped working for me on 10.0.22631.2050.

reidprichard avatar Sep 29 '23 18:09 reidprichard

Thanks @Viqsi! :) I've applied the update to _VD.ahk, basically the same diff but without the new splitByDot calculation and revNumber and it works: https://gist.github.com/JanChec/a555a42c949ff5f6b78e92362143a9d2

JanChec avatar Sep 30 '23 05:09 JanChec

Just a heads up to the others in this thread that the GUID for the COM has also changed with this months release. Fix in this PR https://github.com/FuPeiJiang/VD.ahk/pull/62

phazei avatar Dec 31 '23 07:12 phazei

So far as I can tell this was resolved with 02f37bf. (The referenced commit above presumably fixed it for the AHKv1 version; this one fixes it for the v2 version). At least, I tested it and it Works For Me on build 22631.3155, so I've closed the PR from my fork and will be doing a pull shortly (read: as soon as I get around to it, if I get around to it ;) ).

Viqsi avatar Mar 04 '24 01:03 Viqsi