Slion / VirtualDesktop

C# wrapper for the Virtual Desktop API on Windows 11.
MIT License
21 stars 9 forks source link

Should handle Win11 22621.2215 #2

Closed mzomparelli closed 1 year ago

mzomparelli commented 1 year ago

https://github.com/Slion/VirtualDesktop/issues/1

mzomparelli commented 1 year ago

Wait I forgot to change the GUIDs

mzomparelli commented 1 year ago

Well I can put the new GUIDs in here, but I'm not sure how the old ones get retained for backward compatibility.

mzomparelli commented 1 year ago

Try it with these.

<string>IApplicationView,{372E1D3B-38D3-42E4-A15B-8AB2B178F513}</string>
<string>IApplicationViewCollection,{1841C6D7-4F9D-42C0-AF41-8747538F10E5}</string>
<string>IObjectArray,{92CA9DCD-5622-4BBA-A805-5E9F541BD8C9}</string>
<string>IServiceProvider,{6D5140C1-7436-11CE-8034-00AA006009FA}</string>
<string>IVirtualDesktop,{3F07F4BE-B107-441A-AF0F-39D82529072C}</string>
<string>IVirtualDesktopManager,{A5CD92FF-29BE-454C-8D04-D82879FB3F1B}</string>
<string>IVirtualDesktopManagerInternal,{A3175F2D-239C-4BD2-8AA0-EEBA8B0B138E}</string>
<string>IVirtualDesktopNotification,{B287FA1C-7771-471A-A2DF-9B6B21F0D675}</string>
<string>IVirtualDesktopNotificationService,{0cd45e71-d927-4f15-8b0a-8fef525337bf}</string>
<string>IVirtualDesktopPinnedApps,{4CE81583-1E4C-4632-A621-07A53543148F}</string>
mzomparelli commented 1 year ago

I update the app.config to include the new guids. Sorry. I'm new to doing it like this. I actually like it but I'm still getting used to it. This library is nicely written.

If this works for Win11 22H2 22621.2215 then I will add for Windows Server 2019 and Server 2022.

Dexterously commented 1 year ago

@mzomparelli

The bad news is that even with the latest commit I still see this error. Not sure I understand what's going on as good as you do, but its the same error. For some reason the IVirtualDesktopManagerInternal is failing to create image

mzomparelli commented 1 year ago

Sorry, I should have installed my build tools in the Win 11 env and tested. I'm doing that now, but it's on the right track.

Dexterously commented 1 year ago

o

Sorry, I should have installed my build tools in the Win 11 env and tested. I'm doing that now, but it's on the right track.

No worries. Don't apologize. I know how it goes.

I'll do my best to support and help test.

mzomparelli commented 1 year ago

Wow, why app.config and Properties/Settings.settings for GUIDS? I have to dig into that more but the current commit finally gets it working on Win 11 22621.2215. Tested and verified.

mzomparelli commented 1 year ago

I'm going to switch zVirtualDesktop to use this dll and I will continue to help maintain this. I need to add older support and support for Windows Server 2019 and 2022 first.

mzomparelli commented 1 year ago

Oh it turns out the ordering wasn't necessary because it is ordering it when calling. But still, let's keep them in order for our own sanity. image

mzomparelli commented 1 year ago

Oh I see now, the app.config is being created from Settings.settings - Have to fix the ordering in there if we want it ordered.

Dexterously commented 1 year ago

Agreed. I saw all the changes and can confirm that everything is working in this latest commit. All the events, and functions that I've tested are working.

Excellent!

mzomparelli commented 1 year ago

Apart from maintaining the DLL, what projects have you guys used this for? Or how are you making use of it?

Dexterously commented 1 year ago

I use it for a desktop widget that allows me to switch between desktops.

image

image

Slion commented 1 year ago

That looks awesome. I have not tested it yet. My concern with those changes as they are is that they would break builds 22621 before the 2215 upgrade, right? I'll see if I can combine them with https://github.com/Slion/VirtualDesktop/tree/feature_os_build_revision

Slion commented 1 year ago

Apart from maintaining the DLL, what projects have you guys used this for? Or how are you making use of it?

https://slions.net/resources/taskbar.13/

Slion commented 1 year ago

@mzomparelli I merged it all on Slion:feature_support_22621_2215 but can't get it to run on my PC: image

I sent you guys collaborators invites. You should be able to work directly on that branch.

Slion commented 1 year ago

Oh I see now, the app.config is being created from Settings.settings - Have to fix the ordering in there if we want it ordered.

I think it should be the other way around. Also the type in app.config should be XML to keep it readable. But yeah that stuff is rather messy and the settings generator does get confused.

Slion commented 1 year ago

Good news, I got it running by sorting out the app.config. Please keep changes to the app.config to a minimum. No re-ordering for now. We can do that later on in a dedicated commit.

mzomparelli commented 1 year ago

Good news, I got it running by sorting out the app.config. Please keep changes to the app.config to a minimum. No re-ordering for now. We can do that later on in a dedicated commit.

Why? The ordering comes from Settings.settings. What exactly was your issue? The ordering didnt break it.

mzomparelli commented 1 year ago

That looks awesome. I have not tested it yet. My concern with those changes as they are is that they would break builds 22621 before the 2215 upgrade, right? I'll see if I can combine them with https://github.com/Slion/VirtualDesktop/tree/feature_os_build_revision

It should not break prior to 22621 because the 22000 code is still there.

Dexterously commented 1 year ago

@Slion, you might need to delete the "slions.net" in appdata if you've built it before. Or else it'll keep trying to run a previously built dll.

mzomparelli commented 1 year ago

The issue with the reordering was I messed up the GUIDS...doh. Fixed now in my commit, The app.config should never be modified manullly.

Slion commented 1 year ago

@mzomparelli Actually I do modify app.config manually but that might just be me 😁 Not sure in which commit you fixed that but I merged all that stuff to main already. Doing a new release now. Do take a look at the latest changes as we are now using full 9 digits OS Build to resolve interfaces variants.

Slion commented 1 year ago

@Slion, you might need to delete the "slions.net" in appdata if you've built it before. Or else it'll keep trying to run a previously built dll.

Yeah I kept deleting the DLL too.

mzomparelli commented 1 year ago

@Slion, you might need to delete the "slions.net" in appdata if you've built it before. Or else it'll keep trying to run a previously built dll.

Yeah I kept deleting the DLL too.

This is not an issue for me. How is the DLL going into appdata for you guys? Maybe that is your tool that is using the DLL doingit. I'm just running the build of the Showcase app that is part of the build process. It's an exe and the DLL is in the same folder

mzomparelli commented 1 year ago

oh I think because you are doing the nuget maybe?

Slion commented 1 year ago

VirtualDesktop generates a proxy DLL at runtime. It is stored in the app data folder. If you do changes to the interfaces you need to delete it to make sure it is generated anew. Though it is versioned and if there is a version mismatched it will be regenerated too. So manual deletion should now only be needed on developers machine during development

mzomparelli commented 1 year ago

Oh I see. I guess because by the time it generated that dll it was my only version since I just started testing with it. I'll keep this in mind.

mzomparelli commented 1 year ago

Sorry for all the stupid comments and questions. I am still wrapping my head around the entire project. I think I got it now.

Slion commented 1 year ago

I am still wrapping my head around the entire project. I think I got it now.

Me too mate. I had never came across such a solution. I did not even know you could generate assembly at runtime that easily with C#.

Sorry for all the stupid comments and questions.

There is no stupid question. What's stupid is not to ask the question and assume you already know everything better than anyone else 😁

mzomparelli commented 1 year ago

That was my first pull request ever. The server 2022 is my second and I already did a third on another project.