Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Windows Build 23606: VD.getCurrentDesktopNum() always returns 0 #61

Open
phazei opened this issue Dec 31, 2023 · 4 comments
Open

New Windows Build 23606: VD.getCurrentDesktopNum() always returns 0 #61

phazei opened this issue Dec 31, 2023 · 4 comments

Comments

@phazei
Copy link

phazei commented Dec 31, 2023

Yesterday my windows just did an update and my script stopped working. I'm now on Insider Build 23606. I was previously on 23451 and it's been working just fine there.

@phazei phazei changed the title VD.getCurrentDesktopNum() always returns 0 New Windows Build 23606: VD.getCurrentDesktopNum() always returns 0 Dec 31, 2023
@phazei
Copy link
Author

phazei commented Dec 31, 2023

I took a look at the comments and it seems the GUID's changed for the later versions of Win11:

https://github.com/MScholtes/VirtualDesktop/blob/master/VirtualDesktop11-23H2.cs#L149-L190

I'm going to try switching those and see if it works or if it needs new win11 23h2 functions

@phazei
Copy link
Author

phazei commented Dec 31, 2023

So, I'm really hoping the 23606 build I'm on matches the 23H2 build that has the new GUIDs. It took me a bit to understand, but I see now that the _vtable method is mapping the methods from the COMs. I updated the COM GUIDs to match the updated ones, but that didn't work by itself. I think the parameters for 23H2 so I changed the call back to:
DllCall(this.GetCurrentDesktop, "UPtr", this.IVirtualDesktopManagerInternal, "Ptr*", IVirtualDesktop_ofCurrentDesktop)

GetCurrentDesktop doesn't seem to return anything though, it seems to have been sharing the same _vtable 6 position so I didn't want to change that. But how exactly did you find out what # it was in the list? Is it possible to see the list of how the vtable looks like? I only have SciTE4AutoHotKey to debug this all and it only shows a long number for the values. Also, it seems GetCurrentDesktop returns an item of type IVirtualDesktop eg 3F07F4BE-B107-441A-AF0F-39D82529072C, so how does it get GetId() from it? I don't quite see where that comes from.

@phazei
Copy link
Author

phazei commented Dec 31, 2023

So, it seems like the MScholtes/VirtualDesktop repo probably wouldn't work either. I'm not sure if this repo needed to be updated to match 23H2.

What I did find is a solution though. I found this https://github.com/itzjakm/VirtualDesktopAccessor (I'm guessing there's a typo and the submitter meant 23601). Seems to be a similar project but uses rust and compiles a DLL to be used with AHK. But they seem to have fixed it and found that there was an even more updated GUID. I updated that GUID and a couple others, then reverted the Win11 Insider build _vtable numbers back to stable Win11 numbers, and reverted a few Win11 method calls back to their Win10 equivalent, and it seems to be working now!

@JanChec
Copy link

JanChec commented Jan 15, 2024

The version from ↑ PR works! Thanks! 🥇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants