From d8d49a865428b238691777b4ba8b5c9b53ee69e6 Mon Sep 17 00:00:00 2001 From: Dexterously Date: Fri, 16 Feb 2024 18:25:32 +0000 Subject: [PATCH] Fix for 22631.3155 --- .../Interop/Build22631_3155/.Provider.cs | 47 ++++++++++ .../.interfaces/IVirtualDesktop.cs | 24 +++++ .../IVirtualDesktopManagerInternal.cs | 54 +++++++++++ .../IVirtualDesktopNotification.cs | 93 +++++++++++++++++++ .../IVirtualDesktopNotificationService.cs | 15 +++ .../Interop/Build22631_3155/VirtualDesktop.cs | 31 +++++++ .../VirtualDesktopManagerInternal.cs | 68 ++++++++++++++ .../VirtualDesktopNotificationService.cs | 87 +++++++++++++++++ .../Properties/Settings.Designer.cs | 23 ++++- .../Properties/Settings.settings | 15 +++ src/VirtualDesktop/VirtualDesktop.csproj | 4 + src/VirtualDesktop/VirtualDesktop.system.cs | 6 ++ src/VirtualDesktop/app.config | 16 ++++ 13 files changed, 482 insertions(+), 1 deletion(-) create mode 100644 src/VirtualDesktop/Interop/Build22631_3155/.Provider.cs create mode 100644 src/VirtualDesktop/Interop/Build22631_3155/.interfaces/IVirtualDesktop.cs create mode 100644 src/VirtualDesktop/Interop/Build22631_3155/.interfaces/IVirtualDesktopManagerInternal.cs create mode 100644 src/VirtualDesktop/Interop/Build22631_3155/.interfaces/IVirtualDesktopNotification.cs create mode 100644 src/VirtualDesktop/Interop/Build22631_3155/.interfaces/IVirtualDesktopNotificationService.cs create mode 100644 src/VirtualDesktop/Interop/Build22631_3155/VirtualDesktop.cs create mode 100644 src/VirtualDesktop/Interop/Build22631_3155/VirtualDesktopManagerInternal.cs create mode 100644 src/VirtualDesktop/Interop/Build22631_3155/VirtualDesktopNotificationService.cs diff --git a/src/VirtualDesktop/Interop/Build22631_3155/.Provider.cs b/src/VirtualDesktop/Interop/Build22631_3155/.Provider.cs new file mode 100644 index 0000000..bad8d9c --- /dev/null +++ b/src/VirtualDesktop/Interop/Build22631_3155/.Provider.cs @@ -0,0 +1,47 @@ +using WindowsDesktop.Interop.Build10240; +using WindowsDesktop.Interop.Proxy; + +namespace WindowsDesktop.Interop.Build22631; + +internal class VirtualDesktopProvider22631 : VirtualDesktopProvider +{ + private IVirtualDesktopManager? _virtualDesktopManager; + private ApplicationViewCollection? _applicationViewCollection; + private VirtualDesktopManagerInternal? _virtualDesktopManagerInternal; + private VirtualDesktopPinnedApps? _virtualDesktopPinnedApps; + private VirtualDesktopNotificationService? _virtualDesktopNotificationService; + + public override IApplicationViewCollection ApplicationViewCollection + => this._applicationViewCollection ?? throw InitializationIsRequired; + + public override IVirtualDesktopManager VirtualDesktopManager + => this._virtualDesktopManager ?? throw InitializationIsRequired; + + public override IVirtualDesktopManagerInternal VirtualDesktopManagerInternal + => this._virtualDesktopManagerInternal ?? throw InitializationIsRequired; + + public override IVirtualDesktopPinnedApps VirtualDesktopPinnedApps + => this._virtualDesktopPinnedApps ?? throw InitializationIsRequired; + + public override IVirtualDesktopNotificationService VirtualDesktopNotificationService + => this._virtualDesktopNotificationService ?? throw InitializationIsRequired; + + private protected override void InitializeCore(ComInterfaceAssembly assembly) + { + var type = Type.GetTypeFromCLSID(CLSID.VirtualDesktopManager) + ?? throw new Exception($"No type found for CLSID '{CLSID.VirtualDesktopManager}'."); + this._virtualDesktopManager = Activator.CreateInstance(type) is IVirtualDesktopManager manager + ? manager + : throw new Exception($"Failed to create instance of Type '{typeof(IVirtualDesktopManager)}'."); + + this._applicationViewCollection = new ApplicationViewCollection(assembly); + var factory = new ComWrapperFactory( + x => new ApplicationView(assembly, x), + x => this._applicationViewCollection.GetViewForHwnd(x), + x => new VirtualDesktop(assembly, x)); + this._virtualDesktopPinnedApps = new VirtualDesktopPinnedApps(assembly, factory); + this._virtualDesktopManagerInternal = new VirtualDesktopManagerInternal(assembly, factory); + this._virtualDesktopNotificationService = new VirtualDesktopNotificationService(assembly, factory); + } + +} diff --git a/src/VirtualDesktop/Interop/Build22631_3155/.interfaces/IVirtualDesktop.cs b/src/VirtualDesktop/Interop/Build22631_3155/.interfaces/IVirtualDesktop.cs new file mode 100644 index 0000000..7118436 --- /dev/null +++ b/src/VirtualDesktop/Interop/Build22631_3155/.interfaces/IVirtualDesktop.cs @@ -0,0 +1,24 @@ +using System; +using System.Runtime.InteropServices; +using WindowsDesktop.Interop.Build10240; + +namespace WindowsDesktop.Interop.Build22631 +{ + [ComImport] + [Guid("00000000-0000-0000-0000-000000000000") /* replace at runtime */] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + public interface IVirtualDesktop + { + bool IsViewVisible(IApplicationView view); + + Guid GetID(); + + HString GetName(); + + HString GetWallpaperPath(); + + bool IsRemote(); + + + } +} diff --git a/src/VirtualDesktop/Interop/Build22631_3155/.interfaces/IVirtualDesktopManagerInternal.cs b/src/VirtualDesktop/Interop/Build22631_3155/.interfaces/IVirtualDesktopManagerInternal.cs new file mode 100644 index 0000000..89ed070 --- /dev/null +++ b/src/VirtualDesktop/Interop/Build22631_3155/.interfaces/IVirtualDesktopManagerInternal.cs @@ -0,0 +1,54 @@ +using System; +using System.Runtime.InteropServices; +using WindowsDesktop.Interop.Build10240; + +namespace WindowsDesktop.Interop.Build22631 +{ + [ComImport] + [Guid("00000000-0000-0000-0000-000000000000") /* replace at runtime */] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + public interface IVirtualDesktopManagerInternal + { + int GetCount(); + + void MoveViewToDesktop(IApplicationView pView, IVirtualDesktop desktop); + + bool CanViewMoveDesktops(IApplicationView pView); + + IVirtualDesktop GetCurrentDesktop(); + + IObjectArray GetDesktops(); + + IVirtualDesktop GetAdjacentDesktop(IVirtualDesktop pDesktopReference, int uDirection); + + void SwitchDesktop(IVirtualDesktop desktop); + + IVirtualDesktop CreateDesktop(); + + void MoveDesktop(IVirtualDesktop desktop, int nIndex); + + void RemoveDesktop(IVirtualDesktop pRemove, IVirtualDesktop pFallbackDesktop); + + IVirtualDesktop FindDesktop(in Guid desktopId); + + void GetDesktopSwitchIncludeExcludeViews(IVirtualDesktop desktop, out IObjectArray o1, out IObjectArray o2); + + void SetDesktopName(IVirtualDesktop desktop, HString name); + + void SetDesktopWallpaper(IVirtualDesktop desktop, HString path); + + void UpdateWallpaperPathForAllDesktops(HString path); + + void CopyDesktopState(IApplicationView pView0, IApplicationView pView1); + + IVirtualDesktop CreateRemoteDesktop(HString name); + + void SwitchRemoteDesktop(IVirtualDesktop desktop); + + void SwitchDesktopWithAnimation(IVirtualDesktop desktop); + + IVirtualDesktop GetLastActiveDesktop(); + + void WaitForAnimationToComplete(); + } +} diff --git a/src/VirtualDesktop/Interop/Build22631_3155/.interfaces/IVirtualDesktopNotification.cs b/src/VirtualDesktop/Interop/Build22631_3155/.interfaces/IVirtualDesktopNotification.cs new file mode 100644 index 0000000..23192ed --- /dev/null +++ b/src/VirtualDesktop/Interop/Build22631_3155/.interfaces/IVirtualDesktopNotification.cs @@ -0,0 +1,93 @@ +using System; +using System.Runtime.InteropServices; +using WindowsDesktop.Interop.Build10240; + +namespace WindowsDesktop.Interop.Build22631 +{ + [ComImport] + [Guid("00000000-0000-0000-0000-000000000000") /* replace at runtime */] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + public interface IVirtualDesktopNotification + { + void VirtualDesktopCreated(IVirtualDesktop pDesktop); + + void VirtualDesktopDestroyBegin(IVirtualDesktop pDesktopDestroyed, IVirtualDesktop pDesktopFallback); + + void VirtualDesktopDestroyFailed(IVirtualDesktop pDesktopDestroyed, IVirtualDesktop pDesktopFallback); + + void VirtualDesktopDestroyed(IVirtualDesktop pDesktopDestroyed, IVirtualDesktop pDesktopFallback); + + void VirtualDesktopMoved(IVirtualDesktop pDesktop, int nIndexFrom, int nIndexTo); + + void VirtualDesktopNameChanged(IVirtualDesktop pDesktop, HString chName); + + void ViewVirtualDesktopChanged(IApplicationView pView); + + void CurrentVirtualDesktopChanged(IVirtualDesktop pDesktopOld, IVirtualDesktop pDesktopNew); + + void VirtualDesktopWallpaperChanged(IVirtualDesktop pDesktop, HString chPath); + + void VirtualDesktopSwitched(IVirtualDesktop pDesktop); + + void RemoteVirtualDesktopConnected(IVirtualDesktop pDesktop); + } + + internal class VirtualDesktopNotification : VirtualDesktopNotificationService.EventListenerBase, IVirtualDesktopNotification + { + public void VirtualDesktopCreated(IVirtualDesktop pDesktop) + { + this.CreatedCore(pDesktop); + } + + public void VirtualDesktopDestroyBegin(IVirtualDesktop pDesktopDestroyed, IVirtualDesktop pDesktopFallback) + { + this.DestroyBeginCore(pDesktopDestroyed, pDesktopFallback); + } + + public void VirtualDesktopDestroyFailed(IVirtualDesktop pDesktopDestroyed, IVirtualDesktop pDesktopFallback) + { + this.DestroyFailedCore(pDesktopDestroyed, pDesktopFallback); + } + + public void VirtualDesktopDestroyed(IVirtualDesktop pDesktopDestroyed, IVirtualDesktop pDesktopFallback) + { + this.DestroyedCore(pDesktopDestroyed, pDesktopFallback); + } + + public void VirtualDesktopMoved(IVirtualDesktop pDesktop, int nIndexFrom, int nIndexTo) + { + this.MovedCore(pDesktop, nIndexFrom, nIndexTo); + } + + public void VirtualDesktopNameChanged(IVirtualDesktop pDesktop, HString chName) + { + this.RenamedCore(pDesktop, chName); + } + + public void ViewVirtualDesktopChanged(IApplicationView pView) + { + this.ViewChangedCore(pView); + } + + public void CurrentVirtualDesktopChanged(IVirtualDesktop pDesktopOld, IVirtualDesktop pDesktopNew) + { + this.CurrentChangedCore(pDesktopOld, pDesktopNew); + } + + public void VirtualDesktopWallpaperChanged(IVirtualDesktop pDesktop, HString chPath) + { + this.WallpaperChangedCore(pDesktop, chPath); + } + + public void VirtualDesktopSwitched(IVirtualDesktop pDesktop) + { + this.SwitchedCore(pDesktop); + } + + public void RemoteVirtualDesktopConnected(IVirtualDesktop pDesktop) + { + this.RemoteConnectedCore(pDesktop); + } + + } +} diff --git a/src/VirtualDesktop/Interop/Build22631_3155/.interfaces/IVirtualDesktopNotificationService.cs b/src/VirtualDesktop/Interop/Build22631_3155/.interfaces/IVirtualDesktopNotificationService.cs new file mode 100644 index 0000000..a3a90b6 --- /dev/null +++ b/src/VirtualDesktop/Interop/Build22631_3155/.interfaces/IVirtualDesktopNotificationService.cs @@ -0,0 +1,15 @@ +using System; +using System.Runtime.InteropServices; + +namespace WindowsDesktop.Interop.Build22631 +{ + [ComImport] + [Guid("00000000-0000-0000-0000-000000000000") /* replace at runtime */] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + public interface IVirtualDesktopNotificationService + { + uint Register(IVirtualDesktopNotification pNotification); + + void Unregister(uint dwCookie); + } +} diff --git a/src/VirtualDesktop/Interop/Build22631_3155/VirtualDesktop.cs b/src/VirtualDesktop/Interop/Build22631_3155/VirtualDesktop.cs new file mode 100644 index 0000000..f8244ec --- /dev/null +++ b/src/VirtualDesktop/Interop/Build22631_3155/VirtualDesktop.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using WindowsDesktop.Interop.Proxy; + +namespace WindowsDesktop.Interop.Build22631; + +internal class VirtualDesktop : ComWrapperBase, IVirtualDesktop +{ + private Guid? _id; + + public VirtualDesktop(ComInterfaceAssembly assembly, object comObject) + : base(assembly, comObject) + { + } + + public bool IsViewVisible(IntPtr hWnd) + => this.InvokeMethod(Args(hWnd)); + + public Guid GetID() + => this._id ?? (Guid)(this._id = this.InvokeMethod()); + + public string GetName() + => this.InvokeMethod(); + + public string GetWallpaperPath() + => this.InvokeMethod(); + + public bool IsRemote() + => this.InvokeMethod(); +} diff --git a/src/VirtualDesktop/Interop/Build22631_3155/VirtualDesktopManagerInternal.cs b/src/VirtualDesktop/Interop/Build22631_3155/VirtualDesktopManagerInternal.cs new file mode 100644 index 0000000..9ed5758 --- /dev/null +++ b/src/VirtualDesktop/Interop/Build22631_3155/VirtualDesktopManagerInternal.cs @@ -0,0 +1,68 @@ +using System; +using System.Collections.Generic; +using System.Runtime.CompilerServices; +using WindowsDesktop.Interop.Proxy; + +namespace WindowsDesktop.Interop.Build22631; + +internal class VirtualDesktopManagerInternal : ComWrapperBase, IVirtualDesktopManagerInternal +{ + private readonly ComWrapperFactory _factory; + + public VirtualDesktopManagerInternal(ComInterfaceAssembly assembly, ComWrapperFactory factory) + : base(assembly, CLSID.VirtualDesktopManagerInternal) + { + this._factory = factory; + } + + public IEnumerable GetDesktops() + { + var array = this.InvokeMethod(); + if (array == null) yield break; + + var count = array.GetCount(); + var vdType = this.ComInterfaceAssembly.GetType(nameof(IVirtualDesktop)); + + for (var i = 0u; i < count; i++) + { + var ppvObject = array.GetAt(i, vdType.GUID); + yield return new VirtualDesktop(this.ComInterfaceAssembly, ppvObject); + } + } + + public IVirtualDesktop GetCurrentDesktop() + => this.InvokeMethodAndWrap(); + + public IVirtualDesktop GetAdjacentDesktop(IVirtualDesktop pDesktopReference, AdjacentDesktop uDirection) + => this.InvokeMethodAndWrap(Args(((VirtualDesktop)pDesktopReference).ComObject, uDirection)); + + public IVirtualDesktop FindDesktop(Guid desktopId) + => this.InvokeMethodAndWrap(Args(desktopId)); + + public IVirtualDesktop CreateDesktop() + => this.InvokeMethodAndWrap(); + + public void SwitchDesktop(IVirtualDesktop desktop) + => this.InvokeMethod(Args(((VirtualDesktop)desktop).ComObject)); + + public void MoveDesktop(IVirtualDesktop pMove, int nIndex) + => this.InvokeMethod(Args(((VirtualDesktop)pMove).ComObject, nIndex)); + + public void RemoveDesktop(IVirtualDesktop pRemove, IVirtualDesktop pFallbackDesktop) + => this.InvokeMethod(Args(((VirtualDesktop)pRemove).ComObject, ((VirtualDesktop)pFallbackDesktop).ComObject)); + + public void MoveViewToDesktop(IntPtr hWnd, IVirtualDesktop desktop) + => this.InvokeMethod(Args(this._factory.ApplicationViewFromHwnd(hWnd).ComObject, ((VirtualDesktop)desktop).ComObject)); + + public void SetDesktopName(IVirtualDesktop desktop, string name) + => this.InvokeMethod(Args(((VirtualDesktop)desktop).ComObject, new HString(name))); + + public void SetDesktopWallpaper(IVirtualDesktop desktop, string path) + => this.InvokeMethod(Args(((VirtualDesktop)desktop).ComObject, new HString(path))); + + public void UpdateWallpaperPathForAllDesktops(string path) + => this.InvokeMethod(Args(new HString(path))); + + private VirtualDesktop InvokeMethodAndWrap(object?[]? parameters = null, [CallerMemberName] string methodName = "") + => new(this.ComInterfaceAssembly, this.InvokeMethod(parameters, methodName) ?? throw new Exception("Failed to get IVirtualDesktop instance.")); +} diff --git a/src/VirtualDesktop/Interop/Build22631_3155/VirtualDesktopNotificationService.cs b/src/VirtualDesktop/Interop/Build22631_3155/VirtualDesktopNotificationService.cs new file mode 100644 index 0000000..4f57444 --- /dev/null +++ b/src/VirtualDesktop/Interop/Build22631_3155/VirtualDesktopNotificationService.cs @@ -0,0 +1,87 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using WindowsDesktop.Interop.Proxy; +using WindowsDesktop.Utils; + +namespace WindowsDesktop.Interop.Build22631; + +public class VirtualDesktopNotificationService : ComWrapperBase, IVirtualDesktopNotificationService +{ + private readonly ComWrapperFactory _factory; + + internal VirtualDesktopNotificationService(ComInterfaceAssembly assembly, ComWrapperFactory factory) + : base(assembly, CLSID.VirtualDesktopNotificationService) + { + this._factory = factory; + } + + public IDisposable Register(IVirtualDesktopNotification notification) + { + var type = this.ComInterfaceAssembly.GetType("VirtualDesktopNotification"); + var listener = Activator.CreateInstance(type) as EventListenerBase + ?? throw new Exception($"{nameof(EventListenerBase)} inheritance type is not found in the COM interface assembly."); + + listener.Notification = notification; + listener.Factory = this._factory; + + var dwCookie = this.InvokeMethod(Args(listener)); + return Disposable.Create(() => this.Unregister(dwCookie)); + } + + private void Unregister(uint dwCookie) + { + try + { + this.InvokeMethod(Args(dwCookie)); + } + catch (COMException ex) when (ex.Match(HResult.RPC_S_SERVER_UNAVAILABLE)) + { + // Nothing particular to do. + } + } + + public abstract class EventListenerBase + { + internal ComWrapperFactory Factory { get; set; } = null!; + + internal IVirtualDesktopNotification Notification { get; set; } = null!; + + protected void CreatedCore(object pDesktop) + => this.Notification.VirtualDesktopCreated(this.Wrap(pDesktop)); + + protected void DestroyBeginCore(object pDesktopDestroyed, object pDesktopFallback) + => this.Notification.VirtualDesktopDestroyBegin(this.Wrap(pDesktopDestroyed), this.Wrap(pDesktopFallback)); + + protected void DestroyFailedCore(object pDesktopDestroyed, object pDesktopFallback) + => this.Notification.VirtualDesktopDestroyFailed(this.Wrap(pDesktopDestroyed), this.Wrap(pDesktopFallback)); + + protected void DestroyedCore(object pDesktopDestroyed, object pDesktopFallback) + => this.Notification.VirtualDesktopDestroyed(this.Wrap(pDesktopDestroyed), this.Wrap(pDesktopFallback)); + + protected void MovedCore(object pDesktop, int nIndexFrom, int nIndexTo) + => this.Notification.VirtualDesktopMoved(this.Wrap(pDesktop), nIndexFrom, nIndexTo); + + protected void RenamedCore(object pDesktop, HString chName) + => this.Notification.VirtualDesktopRenamed(this.Wrap(pDesktop), chName); + + protected void ViewChangedCore(object view) + => this.Notification.ViewVirtualDesktopChanged(this.Factory.ApplicationView(view).Interface); + + protected void CurrentChangedCore(object pDesktopOld, object pDesktopNew) + => this.Notification.CurrentVirtualDesktopChanged(this.Wrap(pDesktopOld), this.Wrap(pDesktopNew)); + + protected void WallpaperChangedCore(object pDesktop, HString chPath) + => this.Notification.VirtualDesktopWallpaperChanged(this.Wrap(pDesktop), chPath); + + protected void SwitchedCore(object pDesktop) + => this.Notification.VirtualDesktopSwitched(this.Wrap(pDesktop)); + + protected void RemoteConnectedCore(object pDesktop) + => this.Notification.RemoteVirtualDesktopConnected(this.Wrap(pDesktop)); + + private IVirtualDesktop Wrap(object desktop) + => this.Factory.VirtualDesktop(desktop).Interface; + } +} diff --git a/src/VirtualDesktop/Properties/Settings.Designer.cs b/src/VirtualDesktop/Properties/Settings.Designer.cs index 8de0838..0c1dcd5 100644 --- a/src/VirtualDesktop/Properties/Settings.Designer.cs +++ b/src/VirtualDesktop/Properties/Settings.Designer.cs @@ -12,7 +12,7 @@ namespace WindowsDesktop.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.7.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.9.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); @@ -148,5 +148,26 @@ public static Settings Default { return ((global::System.Collections.Specialized.StringCollection)(this["v_22621_2215"])); } } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute(@" + + IApplicationView,{372E1D3B-38D3-42E4-A15B-8AB2B178F513} + IApplicationViewCollection,{1841C6D7-4F9D-42C0-AF41-8747538F10E5} + IObjectArray,{92CA9DCD-5622-4BBA-A805-5E9F541BD8C9} + IServiceProvider,{6D5140C1-7436-11CE-8034-00AA006009FA} + IVirtualDesktop,{3F07F4BE-B107-441A-AF0F-39D82529072C} + IVirtualDesktopManager,{A5CD92FF-29BE-454C-8D04-D82879FB3F1B} + IVirtualDesktopManagerInternal,{53F5CA0B-158F-4124-900C-057158060B27} + IVirtualDesktopNotification,{B9E5E94D-233E-49AB-AF5C-2B4541C3AADE} + IVirtualDesktopNotificationService,{0cd45e71-d927-4f15-8b0a-8fef525337bf} + IVirtualDesktopPinnedApps,{4CE81583-1E4C-4632-A621-07A53543148F} +")] + public global::System.Collections.Specialized.StringCollection v_22631_3155 { + get { + return ((global::System.Collections.Specialized.StringCollection)(this["v_22631_3155"])); + } + } } } diff --git a/src/VirtualDesktop/Properties/Settings.settings b/src/VirtualDesktop/Properties/Settings.settings index a7e5137..2fe1225 100644 --- a/src/VirtualDesktop/Properties/Settings.settings +++ b/src/VirtualDesktop/Properties/Settings.settings @@ -90,6 +90,21 @@ <string>IVirtualDesktopNotification,{B287FA1C-7771-471A-A2DF-9B6B21F0D675}</string> <string>IVirtualDesktopNotificationService,{0cd45e71-d927-4f15-8b0a-8fef525337bf}</string> <string>IVirtualDesktopPinnedApps,{4CE81583-1E4C-4632-A621-07A53543148F}</string> +</ArrayOfString> + + + <?xml version="1.0" encoding="utf-16"?> +<ArrayOfString xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <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,{53F5CA0B-158F-4124-900C-057158060B27}</string> + <string>IVirtualDesktopNotification,{B9E5E94D-233E-49AB-AF5C-2B4541C3AADE}</string> + <string>IVirtualDesktopNotificationService,{0cd45e71-d927-4f15-8b0a-8fef525337bf}</string> + <string>IVirtualDesktopPinnedApps,{4CE81583-1E4C-4632-A621-07A53543148F}</string> </ArrayOfString> diff --git a/src/VirtualDesktop/VirtualDesktop.csproj b/src/VirtualDesktop/VirtualDesktop.csproj index d299846..b910d0f 100644 --- a/src/VirtualDesktop/VirtualDesktop.csproj +++ b/src/VirtualDesktop/VirtualDesktop.csproj @@ -55,6 +55,10 @@ + + + + diff --git a/src/VirtualDesktop/VirtualDesktop.system.cs b/src/VirtualDesktop/VirtualDesktop.system.cs index ccc880f..653922c 100644 --- a/src/VirtualDesktop/VirtualDesktop.system.cs +++ b/src/VirtualDesktop/VirtualDesktop.system.cs @@ -9,6 +9,7 @@ using WindowsDesktop.Interop.Build20348; using WindowsDesktop.Interop.Build22000; using WindowsDesktop.Interop.Build22621; +using WindowsDesktop.Interop.Build22631; using WindowsDesktop.Interop.Proxy; using WindowsDesktop.Properties; using WindowsDesktop.Utils; @@ -53,6 +54,11 @@ private static VirtualDesktopProvider CreateProvider() { Version v = OS.Build; + if (v >= new Version(10, 0, 22631, 3155)) + { + return new VirtualDesktopProvider22631(); + } + if (v >= new Version(10, 0, 22621, 2215)) { return new VirtualDesktopProvider22621(); diff --git a/src/VirtualDesktop/app.config b/src/VirtualDesktop/app.config index 319ebc8..a8a4f2a 100644 --- a/src/VirtualDesktop/app.config +++ b/src/VirtualDesktop/app.config @@ -103,6 +103,22 @@ + + + + IApplicationView,{372E1D3B-38D3-42E4-A15B-8AB2B178F513} + IApplicationViewCollection,{1841C6D7-4F9D-42C0-AF41-8747538F10E5} + IObjectArray,{92CA9DCD-5622-4BBA-A805-5E9F541BD8C9} + IServiceProvider,{6D5140C1-7436-11CE-8034-00AA006009FA} + IVirtualDesktop,{3F07F4BE-B107-441A-AF0F-39D82529072C} + IVirtualDesktopManager,{A5CD92FF-29BE-454C-8D04-D82879FB3F1B} + IVirtualDesktopManagerInternal,{53F5CA0B-158F-4124-900C-057158060B27} + IVirtualDesktopNotification,{B9E5E94D-233E-49AB-AF5C-2B4541C3AADE} + IVirtualDesktopNotificationService,{0cd45e71-d927-4f15-8b0a-8fef525337bf} + IVirtualDesktopPinnedApps,{4CE81583-1E4C-4632-A621-07A53543148F} + + + \ No newline at end of file