Ciantic / VirtualDesktopAccessor

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

Build 22631 #68

Closed itzjakm closed 1 year ago

itzjakm commented 1 year ago

Changes to make the DLL compatible with Build 22631.2115.

mzomparelli commented 1 year ago

Did you test IVirtualDesktopNotification? I ask because it's not work and I have the same interface as you including the guid.

How did you find the new guid for these? Did you use OleDotNet? That did not work for me on 22621. However in IDA i was able to see some new stuff regarding remote virtual desktops. Have you heard anything about that?

[ComImport]
[Guid("B287FA1C-7771-471A-A2DF-9B6B21F0D675")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IVirtualDesktopNotification
{
    void VirtualDesktopCreated(IObjectArray p1, IVirtualDesktop pDesktop);

    void VirtualDesktopDestroyBegin(IObjectArray p1, IVirtualDesktop pDesktopDestroyed, IVirtualDesktop pDesktopFallback);

    void VirtualDesktopDestroyFailed(IObjectArray p1, IVirtualDesktop pDesktopDestroyed, IVirtualDesktop pDesktopFallback);

    void VirtualDesktopDestroyed(IObjectArray p1, IVirtualDesktop pDesktopDestroyed, IVirtualDesktop pDesktopFallback);

    //void Unknown2(int i);

    void VirtualDesktopMoved(IObjectArray p1, IVirtualDesktop pDesktop, int nIndexFrom, int nIndexTo);

    void VirtualDesktopRenamed(IVirtualDesktop pDesktop, [MarshalAs(UnmanagedType.HString)] string name);

    void ViewVirtualDesktopChanged(IntPtr pView);

    void CurrentVirtualDesktopChanged(IObjectArray p1, IVirtualDesktop pDesktopOld, IVirtualDesktop pDesktopNew);

    void VirtualDesktopWallpaperChanged(IVirtualDesktop pDesktop, [MarshalAs(UnmanagedType.HString)] string path);

    IVirtualDesktop VirtualDesktopSwitched();

    IVirtualDesktop RemoteVirtualDesktopConnected();

}
mzomparelli commented 1 year ago

oh i forgot to remove the monitor stuff. It does work when I remove that so my interface was not exactly like yours. Anyway, I'm still curious your method of obtaining the guids and your thoughts on that new stuff for remote desktops.

itzjakm commented 1 year ago

I used this (Feel free to check out also the original, I don't remember but I think I used the fork linked at the start). It can be a bit tricky to run it, especially you need to link the msdia dll (For me it worked at this path "C:\Program Files (x86)\Common Files\Microsoft Shared\VC\amd64\msdia80.dll") but it did take me a bit of time to be able to run it. I don't know anything about the new stuff, I just tried to make the dll work with the methods that I already use when it broke, it should work for every method in the readme of the VirtualDesktopAccessor (or so I think), but I don't know about the new things. Feel free to ask anything more.

mzomparelli commented 1 year ago

Thank you for the link to that repo and additional info to help get me going with it. I'll check it out.

mzomparelli commented 1 year ago

That Python script is awesome! It does what I was doing manually using IDA Free. Thanks again for sharing.

itzjakm commented 1 year ago

You Welcome

Ciantic commented 1 year ago

Saved me a bit of googling. Thanks!

THAT Script is amazing, will check it out too!