Ciantic / VirtualDesktopAccessor

DLL for accessing Windows 11/10 Virtual Desktop features from e.g. AutoHotkey
MIT License
760 stars 93 forks source link

Rename desktop #32

Closed jpathy closed 1 year ago

jpathy commented 4 years ago

New windows version(from 18975) has an option to rename the desktop name. Can you add that to api? How did you figure out the undocumented com interface?

Ciantic commented 4 years ago

Great idea! I will look in to that once it's released.

If you are truly interested how to discover the API. Get OleViewDotNet, it's great!

  1. Interfaces by Name (search for VirtualDesktop)
  2. Then just right click, "View Proxy Definition".

image

It won't give us the names of the functions, but the definitions. I've discovered the names by googling. There is always some microsofter who leaks the names of the functions.

However, names are not required, only the parameter definitions. It's just really difficult to figure out what is what without names.

jpathy commented 4 years ago

Alright the updated version has ${I}2 interfaces, which has one extra method which is likely related to naming of the desktop.

Annotation 2020-05-23 041424

I will play around and see how the methods work.

Edit: Thanks for the tool recommendation. I did try oleview.exe from SDK before but it didn't work and failed to query the interface definition.

jpathy commented 4 years ago

How do you get which CLSIDs implement them? The old CLSIDs have changed.

jpathy commented 4 years ago

Alright the extra renaming and getting the name of IVirtualDesktop works on the same CLSID objects. Annotation 2020-05-25 055217

But i still don't know why these classes aren't registered in HKEY_CLASSES_ROOT \CLSID. They don't show up in OleView either.

Ciantic commented 4 years ago

I don't know exactly how all of the CLSID's are found. If I have changed them I have copied them elsewhere. I think some of them are called Service GUID's (not sure do they differ from CLSID), because they use QueryService from IServiceProvider. I guess one could find them out somehow from inside the binaries or DLL files.

garyng commented 4 years ago

Since Windows 20H1 is officially out now, will this API get added?

Ciantic commented 4 years ago

@garyng it's actually in my Rust library already. I will do a DLL from Rust repo when I have time. Idea is to ditch the C++ and generate the DLL from Rust directly.

nodgear commented 3 years ago

Hello! how's the progress since this issue?

I was wondering if we could get rename (and also get name) to work on a pre-compiled DLL?. I'm using the dll on my electron app to handle the window between virtual desktops and i would love to see the naming feature, but i don't have the know-how to build a dll out of rust.

ElectroLund commented 1 year ago

I second the request for getting the names of desktops! I'm about to write a script that detects which desktop the user is currently viewing, for display/reporting purposes.

I was going to do this by registry sniffing, but that would result in some constantly running processes.

The keys seem to be here: Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VirtualDesktops

nodgear commented 1 year ago

Hello! how's the progress since this issue?

I was wondering if we could get rename (and also get name) to work on a pre-compiled DLL?. I'm using the dll on my electron app to handle the window between virtual desktops and i would love to see the naming feature, but i don't have the know-how to build a dll out of rust.

Now i do! But tried finding more about the virtual desktop API and turns out it's poorly or not documented AT ALL

Ciantic commented 1 year ago

Two years later, now it's implemented for Windows 11, currently, I don't work on Windows 10 anymore.

Windows 11 second DLL has GetDesktopName and SetDesktopName