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

A problem with the new Windows update 11

Open aliztori opened this issue 1 year ago • 18 comments

Error: (0x80004002) No such interface supported

---- 
026: this.MoveWindowToDesktop := this._vtable(this.IVirtualDesktopManager.Ptr, 5)
027: this.IServiceProvider := ComObject("{C2F03A33-21F5-47FA-B4BB-156362A2F239}", "{6D5140C1-7436-11CE-8034-00AA006009FA}")

▶ 028: this.IVirtualDesktopManagerInternal := ComObjQuery(this.IServiceProvider.Ptr, "{C5E0CDCA-7B6E-41B2-9FC4-D93975CC467B}", IID_IVirtualDesktopManagerInternal_) 029: this.MoveViewToDesktop := this._vtable(this.IVirtualDesktopManagerInternal.Ptr, 4) 030: this.CanViewMoveDesktops := this._vtable(this.IVirtualDesktopManagerInternal.Ptr, 5)

aliztori avatar Sep 13 '23 18:09 aliztori

I encountered the same issue. VD.ahk can't be used anymore.

zhcqiu avatar Sep 14 '23 12:09 zhcqiu

I encountered the same issue. 😭

bgriffy avatar Sep 14 '23 15:09 bgriffy

I'm having the same issue!

youderian avatar Sep 14 '23 17:09 youderian

Same issue, Also looks like VirtualDesktop.cs has a newer version. I tried replacing that but it seems the UUID have changed. Awesome script by the way, it makes moving current windows between VDs so easy. so PLEASE FIX :-)

messmerizaRB avatar Sep 14 '23 22:09 messmerizaRB

Just updated and yes it stopped working. I don't know enough to fix it so I am hoping it will be fixed soon 🙏 windows is a pain to use without this.

theb0ringdev avatar Sep 15 '23 12:09 theb0ringdev

Has worked perfectly until latest Windows updates (KB5031217) and (KB5030219) installed last night

Now receive error message when I attempt to switch desktops:


Error: This value of type "Class" has no property named "GetDesktops".

---- D:\Data\AutoHotkey2\VD2\VD.ah2
084: {
085: IObjectArray := 0

▶ 086: DllCall(this.GetDesktops, "UPtr", this.IVirtualDesktopManagerInternal.Ptr, "Ptr", 0, "UPtr*", &IObjectArray := 0) 087: Return IObjectArray 088: }

Any solution would be greatly appreciated.

anxxx avatar Sep 16 '23 00:09 anxxx

I ran into the same issue.

I was was able to resolve issues for my personal workflows. you can see my changes here.

I didn't post an MR for a couple of reasons:

  1. the changes generically target win11 build 22621. I don't know enough to isolate >= 2215 patch.
  2. I only tested VD.ah2 methods that I use personally (namely getCurrentDesktopNum, getCount, goToDesktopNum and MoveWindowToDesktopNum). Further changes are likely required to support all methods.
  3. I only made changes to the v2_port branch

It was a headache tracking down the updated interface id's. @MScholtes Virtual Desktop project is an amazing reference. thanks to him and @FuPeiJiang for their contributions to open source. hopefully my commit is useful for others. ❤️

mac-s-g avatar Sep 16 '23 23:09 mac-s-g

@mac-s-g Thank you so much! That fixed things for my use case (MoveWindowToDesktopNum, goToDesktopNum). Really appreciate your work and taking the time to share.

youderian avatar Sep 17 '23 00:09 youderian

@mac-s-g Many many thanks and for finding a solution so quickly. Your changes work perfectly with Windows build 22621.2283. Having just programmed a Stream Deck keyboard to enable me to switch desktops and move apps with a single keystroke I was distraught that it was no longer working. Anyway, you have saved the day - at least until the next Windows update!

anxxx avatar Sep 17 '23 15:09 anxxx

Me and my friend are on AHK V1 and can confirm that the update has broke it too. Any chance of a fix for V1 too?

RalfReddings avatar Sep 18 '23 14:09 RalfReddings

@RalfReddings i ported my changes over to the class_VD branch (AHK v1). here's the diff

hope this helps.

fyi - I noticed while porting changes over that FindDesktop and RemoveDesktop point to the same method. I'm guessing I broke RemoveDesktop, but none of my automations reference it so I never encountered the problem.

mac-s-g avatar Sep 18 '23 20:09 mac-s-g

@RalfReddings i ported my changes over to the class_VD branch (AHK v1). here's the diff

hope this helps.

fyi - I noticed while porting changes over that FindDesktop and RemoveDesktop point to the same method. I'm guessing I broke RemoveDesktop, but none of my automations reference it so I never encountered the problem.

Thanks so much for this fix!

messmerizaRB avatar Sep 18 '23 22:09 messmerizaRB

My scripts based on _VD.ahk also stopped working, waiting for a solution. The solution from @mac-s-g seems temp and modifies a file with a different name.

Michael-Steshenko avatar Sep 28 '23 15:09 Michael-Steshenko

Thanks @mac-s-g . I had to further modify VD.ah2 to get it to work on my windows 11 build 22621. Lines 65 and 66 changed to: this.Ptr_CreateDesktop := this._vtable(this.IVirtualDesktopManagerInternal.Ptr, 10) this.Ptr_RemoveDesktop := this._vtable(this.IVirtualDesktopManagerInternal.Ptr, 12)

daveM246 avatar Oct 05 '23 03:10 daveM246

thanks for the fix @daveM246! i committed the change to my v2_port branch and it resolved an error that cropped up recently.

mac-s-g avatar Oct 18 '23 19:10 mac-s-g

I replaced the first 92 lines into my current VD.ah2 and now it works. Thanks @daveM246 and @mac-s-g !

https://github.com/FuPeiJiang/VD.ahk/compare/v2_port...mac-s-g:VD.ahk:v2_port

Edit

The reason I only replaced those lines was because I had an older commit checked out due to https://github.com/FuPeiJiang/VD.ahk/issues/53 . (I'm not sure if it's the one I posted or actually 7978eb594ecd565765aec7c2c59eb8cfb7ccf7ea)

But after booting up today I was only getting errors for VD.ah2 so ended up just checking v2_port current again and replacing VD.ah2 with your version and now it's working. Thanks! a ** Edit 2** It stopped working... I finally figured out that for some reason the changes after that commit I posted above makes using the Arrow Keys not work. E.g.

^#left::VD.goToDesktopNum(1)
^#down::VD.goToDesktopNum(2)
^#right::VD.goToDesktopNum(3)
^#up::VD.goToDesktopNum(4)

does not work.

So I substituted

^#J:: VD.goToDesktopNum(1)
^#K:: VD.goToDesktopNum(2)
^#L:: VD.goToDesktopNum(3)
^#I:: VD.goToDesktopNum(4)

and now they're working fine.

Stan-Stani avatar Oct 20 '23 14:10 Stan-Stani

If you've been hanging out with a forked or locally modified version of VD.ahk, I recommend giving the latest version here a try; it looks to me like the issues have recently been fixed but that just wasn't communicated at the time.

Viqsi avatar Mar 04 '24 01:03 Viqsi

@Viqsi Thanks for dropping the note! Things are now working as normal in my AHK V1 script. (I updated the _VD.ahk from this repo, and used VirtualDesktopAccessor.dll from this other repo.)

llinfeng avatar Mar 10 '24 22:03 llinfeng