VirtualDesktop icon indicating copy to clipboard operation
VirtualDesktop copied to clipboard

Not working with Windows 11 22H2 ?

Open 3dtoall opened this issue 3 years ago • 37 comments

Works on Windows 10. Testing on Windows 11 22H2, I get this error: w11_22H2_error

3dtoall avatar Jun 15 '22 13:06 3dtoall

Me too

Dexterously avatar Sep 14 '22 04:09 Dexterously

Looks like this is due to missing CLSIDs and possibly the addition of [GetAllCurrentDesktops](https://github.com/newlooper/VirtualSpace/blob/main/VirtualDesktop11/COM.cs#L173)?

Newlooper's VirtualSpace runs correctly so I hoped plugging in the guids from there would work. I tried adding them for my OS version (22621, but 22H2 is >22489?):

<?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,{536D3495-B208-4CC9-AE26-DE8111275BF8}</string>
	<string>IVirtualDesktopManager,{A5CD92FF-29BE-454C-8D04-D82879FB3F1B}</string>
	<string>IVirtualDesktopManagerInternal,{B2F925B9-5A0F-4D2E-9F4D-2B1507593C10}</string>
	<string>IVirtualDesktopNotification,{cd403e52-deed-4c13-b437-b98380f2b1e8}</string>
	<string>IVirtualDesktopNotificationService,{0cd45e71-d927-4f15-8b0a-8fef525337bf}</string>
	<string>IVirtualDesktopPinnedApps,{4CE81583-1E4C-4632-A621-07A53543148F}</string>
</ArrayOfString>

That leaves the demo with a null reference at GetDesktops()

aquafir avatar Sep 27 '22 18:09 aquafir

After comparing the codes with VirtualSpace

/////////////////////////////////////////////////////////////////
       // COM Interface "B2F925B9-5A0F-4D2E-9F4D-2B1507593C10"
       // for windows 11 22H2 (>22489) COM Interface require this func.
       // for windows 11 21H2 (22000.xxx) this func must be commented
       IObjectArray GetAllCurrentDesktops();
       void GetDesktops( IntPtr hWndOrMon, out IObjectArray desktops );

I tried to add

IObjectArray GetAllCurrentDesktops();

Problem solved. I can run for 22H2

Please try

kenykau avatar Sep 30 '22 10:09 kenykau

@kenykau Can you share the patch of your changes specifically? I tried adding IObjectArray GetAllCurrentDesktops(); with no luck.

patriq avatar Oct 01 '22 19:10 patriq

Index: src/VirtualDesktop/Properties/Settings.Designer.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/VirtualDesktop/Properties/Settings.Designer.cs b/src/VirtualDesktop/Properties/Settings.Designer.cs
--- a/src/VirtualDesktop/Properties/Settings.Designer.cs	(revision a6c69e420307e0717f296501c1e7595977e27b6b)
+++ b/src/VirtualDesktop/Properties/Settings.Designer.cs	(date 1664652742667)
@@ -1,10 +1,10 @@
 //------------------------------------------------------------------------------
 // <auto-generated>
-//     このコードはツールによって生成されました。
-//     ランタイム バージョン:4.0.30319.42000
+//     This code was generated by a tool.
+//     Runtime Version:4.0.30319.42000
 //
-//     このファイルへの変更は、以下の状況下で不正な動作の原因になったり、
-//     コードが再生成されるときに損失したりします。
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
 // </auto-generated>
 //------------------------------------------------------------------------------
 
@@ -12,7 +12,7 @@
     
     
     [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.0.3.0")]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")]
     internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
         
         private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
@@ -85,5 +85,14 @@
                 return ((global::System.Collections.Specialized.StringCollection)(this["v_22000"]));
             }
         }
+        
+        [global::System.Configuration.ApplicationScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute(@"<?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,{536D3495-B208-4CC9-AE26-DE8111275BF8}</string> 	<string>IVirtualDesktopManager,{A5CD92FF-29BE-454C-8D04-D82879FB3F1B}</string> 	<string>IVirtualDesktopManagerInternal,{B2F925B9-5A0F-4D2E-9F4D-2B1507593C10}</string> 	<string>IVirtualDesktopNotification,{cd403e52-deed-4c13-b437-b98380f2b1e8}</string> 	<string>IVirtualDesktopNotificationService,{0cd45e71-d927-4f15-8b0a-8fef525337bf}</string> 	<string>IVirtualDesktopPinnedApps,{4CE81583-1E4C-4632-A621-07A53543148F}</string> </ArrayOfString>")]
+        public global::System.Collections.Specialized.StringCollection v_22621 {
+            get {
+                return ((global::System.Collections.Specialized.StringCollection)(this["v_22621"]));
+            }
+        }
     }
 }
Index: src/VirtualDesktop/Interop/Build22000/.interfaces/IVirtualDesktopManagerInternal.cs
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/VirtualDesktop/Interop/Build22000/.interfaces/IVirtualDesktopManagerInternal.cs b/src/VirtualDesktop/Interop/Build22000/.interfaces/IVirtualDesktopManagerInternal.cs
--- a/src/VirtualDesktop/Interop/Build22000/.interfaces/IVirtualDesktopManagerInternal.cs	(revision a6c69e420307e0717f296501c1e7595977e27b6b)
+++ b/src/VirtualDesktop/Interop/Build22000/.interfaces/IVirtualDesktopManagerInternal.cs	(date 1664654867843)
@@ -17,6 +17,8 @@
 
         IVirtualDesktop GetCurrentDesktop(IntPtr hWndOrMon);
 
+        IObjectArray GetAllCurrentDesktops();
+
         IObjectArray GetDesktops(IntPtr hWndOrMon);
 
         IVirtualDesktop GetAdjacentDesktop(IVirtualDesktop pDesktopReference, int uDirection);
Index: src/VirtualDesktop/app.config
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/VirtualDesktop/app.config b/src/VirtualDesktop/app.config
--- a/src/VirtualDesktop/app.config	(revision a6c69e420307e0717f296501c1e7595977e27b6b)
+++ b/src/VirtualDesktop/app.config	(date 1664652742667)
@@ -1,60 +1,60 @@
 <?xml version="1.0" encoding="utf-8"?>
 <configuration>
-  <configSections>
-    <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-      <section name="WindowsDesktop.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
-    </sectionGroup>
-  </configSections>
-  <applicationSettings>
-    <WindowsDesktop.Properties.Settings>
-      <setting name="v_17134" serializeAs="Xml">
-        <value>
-          <ArrayOfString xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-            <string>IApplicationView,{871F602A-2B58-42B4-8C4B-6C43D642C06F}</string>
-            <string>IApplicationViewCollection,{2C08ADF0-A386-4B35-9250-0FE183476FCC} </string>
-            <string>IObjectArray,{92CA9DCD-5622-4BBA-A805-5E9F541BD8C9} </string>
-            <string>IServiceProvider,{6D5140C1-7436-11CE-8034-00AA006009FA} </string>
-            <string>IVirtualDesktop,{FF72FFDD-BE7E-43FC-9C03-AD81681E88E4} </string>
-            <string>IVirtualDesktopManager,{A5CD92FF-29BE-454C-8D04-D82879FB3F1B} </string>
-            <string>IVirtualDesktopManagerInternal,{F31574D6-B682-4CDC-BD56-1827860ABEC6} </string>
-            <string>IVirtualDesktopNotification,{C179334C-4295-40D3-BEA1-C654D965605A} </string>
-            <string>IVirtualDesktopNotificationService,{0CD45E71-D927-4F15-8B0A-8FEF525337BF} </string>
-            <string>IVirtualDesktopPinnedApps,{4CE81583-1E4C-4632-A621-07A53543148F} </string>
-          </ArrayOfString>
-        </value>
-      </setting>
-      <setting name="v_16299" serializeAs="Xml">
-        <value>
-          <ArrayOfString xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-            <string>IApplicationView,{9AC0B5C8-1484-4C5B-9533-4134A0F97CEA} </string>
-            <string>IApplicationViewCollection,{2C08ADF0-A386-4B35-9250-0FE183476FCC} </string>
-            <string>IObjectArray,{92CA9DCD-5622-4BBA-A805-5E9F541BD8C9} </string>
-            <string>IServiceProvider,{6D5140C1-7436-11CE-8034-00AA006009FA} </string>
-            <string>IVirtualDesktop,{FF72FFDD-BE7E-43FC-9C03-AD81681E88E4} </string>
-            <string>IVirtualDesktopManager,{A5CD92FF-29BE-454C-8D04-D82879FB3F1B} </string>
-            <string>IVirtualDesktopManagerInternal,{F31574D6-B682-4CDC-BD56-1827860ABEC6} </string>
-            <string>IVirtualDesktopNotification,{C179334C-4295-40D3-BEA1-C654D965605A} </string>
-            <string>IVirtualDesktopNotificationService,{0CD45E71-D927-4F15-8B0A-8FEF525337BF} </string>
-            <string>IVirtualDesktopPinnedApps,{4CE81583-1E4C-4632-A621-07A53543148F} </string>
-          </ArrayOfString>
-        </value>
-      </setting>
-      <setting name="v_22000" serializeAs="Xml">
-        <value>
-          <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,{536d3495-b208-4cc9-ae26-de8111275bf8} </string>
-            <string>IVirtualDesktopManager,{a5cd92ff-29be-454c-8d04-d82879fb3f1b} </string>
-            <string>IVirtualDesktopManagerInternal,{b2f925b9-5a0f-4d2e-9f4d-2b1507593c10} </string>
-            <string>IVirtualDesktopNotification,{cd403e52-deed-4c13-b437-b98380f2b1e8} </string>
-            <string>IVirtualDesktopNotificationService,{0cd45e71-d927-4f15-8b0a-8fef525337bf} </string>
-            <string>IVirtualDesktopPinnedApps,{4ce81583-1e4c-4632-a621-07a53543148f} </string>
-          </ArrayOfString>
-        </value>
-      </setting>
-    </WindowsDesktop.Properties.Settings>
-  </applicationSettings>
-</configuration>
+    <configSections>
+        <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+            <section name="WindowsDesktop.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
+        </sectionGroup>
+    </configSections>
+    <applicationSettings>
+        <WindowsDesktop.Properties.Settings>
+            <setting name="v_17134" serializeAs="String">
+                <value>&lt;?xml version="1.0" encoding="utf-16"?&gt;
+&lt;ArrayOfString xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
+  &lt;string&gt;IApplicationView,{871F602A-2B58-42B4-8C4B-6C43D642C06F}&lt;/string&gt;
+  &lt;string&gt;IApplicationViewCollection,{2C08ADF0-A386-4B35-9250-0FE183476FCC} &lt;/string&gt;
+  &lt;string&gt;IObjectArray,{92CA9DCD-5622-4BBA-A805-5E9F541BD8C9} &lt;/string&gt;
+  &lt;string&gt;IServiceProvider,{6D5140C1-7436-11CE-8034-00AA006009FA} &lt;/string&gt;
+  &lt;string&gt;IVirtualDesktop,{FF72FFDD-BE7E-43FC-9C03-AD81681E88E4} &lt;/string&gt;
+  &lt;string&gt;IVirtualDesktopManager,{A5CD92FF-29BE-454C-8D04-D82879FB3F1B} &lt;/string&gt;
+  &lt;string&gt;IVirtualDesktopManagerInternal,{F31574D6-B682-4CDC-BD56-1827860ABEC6} &lt;/string&gt;
+  &lt;string&gt;IVirtualDesktopNotification,{C179334C-4295-40D3-BEA1-C654D965605A} &lt;/string&gt;
+  &lt;string&gt;IVirtualDesktopNotificationService,{0CD45E71-D927-4F15-8B0A-8FEF525337BF} &lt;/string&gt;
+  &lt;string&gt;IVirtualDesktopPinnedApps,{4CE81583-1E4C-4632-A621-07A53543148F} &lt;/string&gt;
+&lt;/ArrayOfString&gt;</value>
+            </setting>
+            <setting name="v_16299" serializeAs="String">
+                <value>&lt;?xml version="1.0" encoding="utf-16"?&gt;
+&lt;ArrayOfString xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
+  &lt;string&gt;IApplicationView,{9AC0B5C8-1484-4C5B-9533-4134A0F97CEA} &lt;/string&gt;
+  &lt;string&gt;IApplicationViewCollection,{2C08ADF0-A386-4B35-9250-0FE183476FCC} &lt;/string&gt;
+  &lt;string&gt;IObjectArray,{92CA9DCD-5622-4BBA-A805-5E9F541BD8C9} &lt;/string&gt;
+  &lt;string&gt;IServiceProvider,{6D5140C1-7436-11CE-8034-00AA006009FA} &lt;/string&gt;
+  &lt;string&gt;IVirtualDesktop,{FF72FFDD-BE7E-43FC-9C03-AD81681E88E4} &lt;/string&gt;
+  &lt;string&gt;IVirtualDesktopManager,{A5CD92FF-29BE-454C-8D04-D82879FB3F1B} &lt;/string&gt;
+  &lt;string&gt;IVirtualDesktopManagerInternal,{F31574D6-B682-4CDC-BD56-1827860ABEC6} &lt;/string&gt;
+  &lt;string&gt;IVirtualDesktopNotification,{C179334C-4295-40D3-BEA1-C654D965605A} &lt;/string&gt;
+  &lt;string&gt;IVirtualDesktopNotificationService,{0CD45E71-D927-4F15-8B0A-8FEF525337BF} &lt;/string&gt;
+  &lt;string&gt;IVirtualDesktopPinnedApps,{4CE81583-1E4C-4632-A621-07A53543148F} &lt;/string&gt;
+&lt;/ArrayOfString&gt;</value>
+            </setting>
+            <setting name="v_22000" serializeAs="String">
+                <value>&lt;?xml version="1.0" encoding="utf-16"?&gt;
+&lt;ArrayOfString xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
+  &lt;string&gt;IApplicationView,{372e1d3b-38d3-42e4-a15b-8ab2b178f513} &lt;/string&gt;
+  &lt;string&gt;IApplicationViewCollection,{1841c6d7-4f9d-42c0-af41-8747538f10e5} &lt;/string&gt;
+  &lt;string&gt;IObjectArray,{92CA9DCD-5622-4BBA-A805-5E9F541BD8C9} &lt;/string&gt;
+  &lt;string&gt;IServiceProvider,{6D5140C1-7436-11CE-8034-00AA006009FA} &lt;/string&gt;
+  &lt;string&gt;IVirtualDesktop,{536d3495-b208-4cc9-ae26-de8111275bf8} &lt;/string&gt;
+  &lt;string&gt;IVirtualDesktopManager,{a5cd92ff-29be-454c-8d04-d82879fb3f1b} &lt;/string&gt;
+  &lt;string&gt;IVirtualDesktopManagerInternal,{b2f925b9-5a0f-4d2e-9f4d-2b1507593c10} &lt;/string&gt;
+  &lt;string&gt;IVirtualDesktopNotification,{cd403e52-deed-4c13-b437-b98380f2b1e8} &lt;/string&gt;
+  &lt;string&gt;IVirtualDesktopNotificationService,{0cd45e71-d927-4f15-8b0a-8fef525337bf} &lt;/string&gt;
+  &lt;string&gt;IVirtualDesktopPinnedApps,{4ce81583-1e4c-4632-a621-07a53543148f} &lt;/string&gt;
+&lt;/ArrayOfString&gt;</value>
+            </setting>
+            <setting name="v_22621" serializeAs="String">
+                <value>&lt;?xml version="1.0" encoding="utf-16"?&gt; &lt;ArrayOfString xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt; 	&lt;string&gt;IApplicationView,{372E1D3B-38D3-42E4-A15B-8AB2B178F513}&lt;/string&gt; 	&lt;string&gt;IApplicationViewCollection,{1841C6D7-4F9D-42C0-AF41-8747538F10E5}&lt;/string&gt; 	&lt;string&gt;IObjectArray,{92CA9DCD-5622-4BBA-A805-5E9F541BD8C9}&lt;/string&gt; 	&lt;string&gt;IServiceProvider,{6D5140C1-7436-11CE-8034-00AA006009FA}&lt;/string&gt; 	&lt;string&gt;IVirtualDesktop,{536D3495-B208-4CC9-AE26-DE8111275BF8}&lt;/string&gt; 	&lt;string&gt;IVirtualDesktopManager,{A5CD92FF-29BE-454C-8D04-D82879FB3F1B}&lt;/string&gt; 	&lt;string&gt;IVirtualDesktopManagerInternal,{B2F925B9-5A0F-4D2E-9F4D-2B1507593C10}&lt;/string&gt; 	&lt;string&gt;IVirtualDesktopNotification,{cd403e52-deed-4c13-b437-b98380f2b1e8}&lt;/string&gt; 	&lt;string&gt;IVirtualDesktopNotificationService,{0cd45e71-d927-4f15-8b0a-8fef525337bf}&lt;/string&gt; 	&lt;string&gt;IVirtualDesktopPinnedApps,{4CE81583-1E4C-4632-A621-07A53543148F}&lt;/string&gt; &lt;/ArrayOfString&gt;</value>
+            </setting>
+        </WindowsDesktop.Properties.Settings>
+    </applicationSettings>
+</configuration>
\ No newline at end of file
Index: src/VirtualDesktop/Properties/Settings.settings
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/VirtualDesktop/Properties/Settings.settings b/src/VirtualDesktop/Properties/Settings.settings
--- a/src/VirtualDesktop/Properties/Settings.settings	(revision a6c69e420307e0717f296501c1e7595977e27b6b)
+++ b/src/VirtualDesktop/Properties/Settings.settings	(date 1664652735773)
@@ -1,10 +1,10 @@
-<?xml version='1.0' encoding='utf-8'?>
+<?xml version="1.0" encoding="UTF-8"?>
 <SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="WindowsDesktop.Properties" GeneratedClassName="Settings">
   <Profiles />
   <Settings>
     <Setting Name="v_17134" Type="System.Collections.Specialized.StringCollection" Scope="Application">
-      <Value Profile="(Default)">&lt;?xml version="1.0" encoding="utf-16"?&gt;
-&lt;ArrayOfString xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
+      <Value Profile="(Default)">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?&gt;
+&lt;ArrayOfString xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&gt;
   &lt;string&gt;IApplicationView,{871F602A-2B58-42B4-8C4B-6C43D642C06F}&lt;/string&gt;
   &lt;string&gt;IApplicationViewCollection,{2C08ADF0-A386-4B35-9250-0FE183476FCC} &lt;/string&gt;
   &lt;string&gt;IObjectArray,{92CA9DCD-5622-4BBA-A805-5E9F541BD8C9} &lt;/string&gt;
@@ -18,8 +18,8 @@
 &lt;/ArrayOfString&gt;</Value>
     </Setting>
     <Setting Name="v_16299" Type="System.Collections.Specialized.StringCollection" Scope="Application">
-      <Value Profile="(Default)">&lt;?xml version="1.0" encoding="utf-16"?&gt;
-&lt;ArrayOfString xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
+      <Value Profile="(Default)">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?&gt;
+&lt;ArrayOfString xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&gt;
   &lt;string&gt;IApplicationView,{9AC0B5C8-1484-4C5B-9533-4134A0F97CEA} &lt;/string&gt;
   &lt;string&gt;IApplicationViewCollection,{2C08ADF0-A386-4B35-9250-0FE183476FCC} &lt;/string&gt;
   &lt;string&gt;IObjectArray,{92CA9DCD-5622-4BBA-A805-5E9F541BD8C9} &lt;/string&gt;
@@ -33,8 +33,8 @@
 &lt;/ArrayOfString&gt;</Value>
     </Setting>
     <Setting Name="v_22000" Type="System.Collections.Specialized.StringCollection" Scope="Application">
-      <Value Profile="(Default)">&lt;?xml version="1.0" encoding="utf-16"?&gt;
-&lt;ArrayOfString xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
+      <Value Profile="(Default)">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?&gt;
+&lt;ArrayOfString xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&gt;
   &lt;string&gt;IApplicationView,{372e1d3b-38d3-42e4-a15b-8ab2b178f513} &lt;/string&gt;
   &lt;string&gt;IApplicationViewCollection,{1841c6d7-4f9d-42c0-af41-8747538f10e5} &lt;/string&gt;
   &lt;string&gt;IObjectArray,{92CA9DCD-5622-4BBA-A805-5E9F541BD8C9} &lt;/string&gt;
@@ -47,5 +47,9 @@
   &lt;string&gt;IVirtualDesktopPinnedApps,{4ce81583-1e4c-4632-a621-07a53543148f} &lt;/string&gt;
 &lt;/ArrayOfString&gt;</Value>
     </Setting>
+    <Setting Name="v_22621" Type="System.Collections.Specialized.StringCollection" Scope="Application">
+      <Value Profile="(Default)">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-16&quot;?&gt; &lt;ArrayOfString xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&gt; 	&lt;string&gt;IApplicationView,{372E1D3B-38D3-42E4-A15B-8AB2B178F513}&lt;/string&gt; 	&lt;string&gt;IApplicationViewCollection,{1841C6D7-4F9D-42C0-AF41-8747538F10E5}&lt;/string&gt; 	&lt;string&gt;IObjectArray,{92CA9DCD-5622-4BBA-A805-5E9F541BD8C9}&lt;/string&gt; 	&lt;string&gt;IServiceProvider,{6D5140C1-7436-11CE-8034-00AA006009FA}&lt;/string&gt; 	&lt;string&gt;IVirtualDesktop,{536D3495-B208-4CC9-AE26-DE8111275BF8}&lt;/string&gt; 	&lt;string&gt;IVirtualDesktopManager,{A5CD92FF-29BE-454C-8D04-D82879FB3F1B}&lt;/string&gt; 	&lt;string&gt;IVirtualDesktopManagerInternal,{B2F925B9-5A0F-4D2E-9F4D-2B1507593C10}&lt;/string&gt; 	&lt;string&gt;IVirtualDesktopNotification,{cd403e52-deed-4c13-b437-b98380f2b1e8}&lt;/string&gt; 	&lt;string&gt;IVirtualDesktopNotificationService,{0cd45e71-d927-4f15-8b0a-8fef525337bf}&lt;/string&gt; 	&lt;string&gt;IVirtualDesktopPinnedApps,{4CE81583-1E4C-4632-A621-07A53543148F}&lt;/string&gt; &lt;/ArrayOfString&gt;</Value>
+    </Setting>
   </Settings>
-</SettingsFile>
\ No newline at end of file
+</SettingsFile>
+

Aight the following patch worked for me!

patriq avatar Oct 01 '22 20:10 patriq

how do you install this patch? Sorry, i don't understand anything.

ZhulaiIvan avatar Oct 03 '22 07:10 ZhulaiIvan

Hi @Grabacr07.

I've made a PR with a fix for this issue on newer Windows 11 builds: https://github.com/Grabacr07/VirtualDesktop/pull/79. This may also fix some newer Window 10 installations due to the changes in how COM GUIDs are selected.

Have a look when you get a chance and let me know if you're happy to accept it as is or you'd like some changes.

maciej-makowski avatar Oct 03 '22 21:10 maciej-makowski

@maciej-makowski,

Thanks a lot! Just downloaded your version and its working 🎉

Dexterously avatar Oct 03 '22 21:10 Dexterously

@maciej-makowski fantastic work. I am still hoping @Grabacr07 will merge this in so I don't have to switch to your fork's code base, however if this isn't coming please consider making more enhancements to your fork :)

maxpavlov avatar Nov 13 '22 19:11 maxpavlov

Thanks a lot @maciej-makowski, I was facing same error and able to run with your fork's code.

renil-joy avatar Nov 16 '22 07:11 renil-joy

I've reached out to @Grabacr07 when I made this change offering help maintaining this library. He hasn't responded yet. I might get around publishing my fork as a separate NuGet package, since I myself came across the issue via https://github.com/glsorre/amethystwindows/issues/86 and it would be great to have a working official build of AmethystWindows.

maciej-makowski avatar Nov 16 '22 20:11 maciej-makowski

Hi @Grabacr07.

I've made a PR with a fix for this issue on newer Windows 11 builds: #79. This may also fix some newer Window 10 installations due to the changes in how COM GUIDs are selected.

Have a look when you get a chance and let me know if you're happy to accept it as is or you'd like some changes.

Hi @maciej-makowski I faced same issue, Used your fork code but now facing following issue after using your branch on Win-10 Pro , build # 19045

Please guide to solve or make another commit. Thanks

System.NotImplementedException: 'The method or operation is not implemented.'

Stack Trace

at WindowsDesktop.Interop.IServiceProvider.QueryService(Guid& guidService, Guid& riid)
   at WindowsDesktop.Interop.ComInterfaceAssembly.CreateInstance(Type type, Nullable`1 guidService) in D:\VirtualDesktop\src\VirtualDesktop\Interop\ComInterfaceAssembly.cs:line 60

Line of Code

private static object CreateInstance(Type type, Guid? guidService)
        {
            var shellType = Type.GetTypeFromCLSID(CLSID.ImmersiveShell)
        ?? throw new Exception($"Type of ImmersiveShell ('{CLSID.ImmersiveShell}') is not found.");
            var shell = Activator.CreateInstance(shellType) as IServiceProvider
                ?? throw new Exception("Failed to create an instance of ImmersiveShell.");

                return shell.QueryService(guidService ?? type.GUID, type.GUID);   **//Error at this Line**
        }

Taster-git avatar Dec 14 '22 13:12 Taster-git

Hi @Taster-git,

That usually means that Microsoft changed the underlying Windows API between versions adding new function or parameter. I don't remember of the top of my head how you can find it, I will try to find some time this weekend to review how what I did few months ago

maciej-makowski avatar Dec 16 '22 11:12 maciej-makowski

Hi @Taster-git,

That usually means that Microsoft changed the underlying Windows API between versions adding new function or parameter. I don't remember of the top of my head how you can find it, I will try to find some time this weekend to review how what I did few months ago

Thanks for your reply. Ok waiting on daily basis.

Taster-git avatar Dec 19 '22 08:12 Taster-git

Does this mean that @maciej-makowski changes which fixed Windows11 22H2 broke support for older Windows 10 versions? I doubt Microsoft is changing those API on Windows10 these days. Last I looked at the code I recall @Grabacr07 had a clever system to support different variant of those APIs so in theory we should be able to fix it without breaking earlier versions. Shame he has been MIA for almost a year now. If only the process of adding support for new Windows version had been documented.

Slion avatar Jan 19 '23 08:01 Slion

I've reached out to @Grabacr07 when I made this change offering help maintaining this library. He hasn't responded yet. I might get around publishing my fork as a separate NuGet package, since I myself came across the issue via glsorre/amethystwindows#86 and it would be great to have a working official build of AmethystWindows.

Hello @maciej-makowski ! Any news or updates? I think is not working on latest Windows 11 version? Thank you to keep updating this.

3dtoall avatar Jul 31 '23 08:07 3dtoall

Hi @3dtoall.

I have never heard back from @Grabacr07 on the maintenance. I was toying with the of maintaining a fork of this package a while ago, but after looking a bit more into it, decided against it.

The reason why this package keeps breaking between Windows upgrades is, it depends on an undocumented low-level functions in Windows API. This is also a reason why it's quite difficult to fix and relese, since every time new Windows 10 or 11 version gets released it's a potential breaking change and you have to reverse-enginner the API calls and patch the library. I briefly looked into automating the process, but couldn't work it out and ultimately gave up on the idea.

I think, until VirtualDesktop Windows API stabilises, this will always be a big maintenance burden and unfortunately, I don't have this much time available.

maciej-makowski avatar Jul 31 '23 18:07 maciej-makowski

Looks like this guy has it working.

Slion avatar Aug 12 '23 16:08 Slion

@maciej-makowski I just test your patch and it seems to work fine still on 22621.

Any chance we could document the reverse engineering process? So that next time around someone else could take that burden?

Slion avatar Aug 12 '23 16:08 Slion

I just published it as Slions.VirtualDesktop for anyone to use. Did minimal testing with it and it seems to be working fine. I'm planning to update that Taskbar Pro app of mine to make use of it.

Slion avatar Aug 12 '23 17:08 Slion

I've added documentation about finding class IDs for your version of Windows: https://github.com/Slion/VirtualDesktop#windows-version-support

Slion avatar Aug 16 '23 17:08 Slion

@Slion This is still broken on build 25926.rs_prerelease.230804-1441

anaisbetts avatar Aug 16 '23 20:08 anaisbetts

Is that insider build? You can follow the instructions above to fetch the IDs. If you give them to me I'll publish them and you can try it out.

Slion avatar Aug 16 '23 21:08 Slion

@Slion Unfortunately it seems they have removed the registry entries that you referenced, at least in some installs (I've read that whether these IID entries exist depend on when you installed the OS), searching for IApplicationView with "Match whole word" returns zero results

anaisbetts avatar Aug 17 '23 05:08 anaisbetts

Could you reference your sources? Did you try to search the whole registry? Maybe it's in another path? If that's the case we will need to find another way to get them, somehow.

Slion avatar Aug 17 '23 06:08 Slion

Looks like this article could be useful to obtain our Ids: https://www.mandiant.com/resources/blog/hunting-com-objects

Would be fantastic if @Grabacr07 and @maciej-makowski would find some time to share their expertise on reverse engineering.

Slion avatar Aug 17 '23 06:08 Slion

Did you try to search the whole registry? Maybe it's in another path?

I searched the entire registry, there are lots of partial matches but checking "Use Whole Word" => zero matches.

anaisbetts avatar Aug 17 '23 07:08 anaisbetts

I searched the entire registry, there are lots of partial matches but checking "Use Whole Word" => zero matches.

That's weird, my insider build is currently 25206 and there too I can't find those ids anywhere in the registry. We will have to find another way then.

Slion avatar Aug 17 '23 15:08 Slion

Looks like the link above is exactly what we need.

You first need to get the list of all CLSID on your system by running the following powershell commands. Mount part of your registry as a drive: New-PSDrive -PSProvider registry -Root HKEY_CLASSES_ROOT -Name HKCR Export the CLSID into a text file: Get-ChildItem -Path HKCR:\CLSID -Name | Select -Skip 1 > clsids.txt

Then I ran a modified version of their script which can be resumed after a crash, that looks like that:

$Position  = 1
$StartAt  = 7004
$Filename = "win10-clsid-members.txt"
$inputFilename = "clsids.txt"
ForEach($CLSID in Get-Content $inputFilename) {
      
      if ($Position -ge $StartAt) {
            Write-Output "$($Position) - $($CLSID)"
            Write-Output "------------------------" | Out-File $Filename -Append
            Write-Output "$($Position)" | Out-File $Filename -Append
            Write-Output "------------------------" | Out-File $Filename -Append
            Write-Output $($CLSID) | Out-File $Filename -Append
            $handle = [activator]::CreateInstance([type]::GetTypeFromCLSID($CLSID))
            $handle | Get-Member | Out-File $Filename -Append
      } else {
            Write-Output "Skip $($Position) - $($StartAt)"
      }

      $Position += 1
}


# Crash on:
# 587
# 845
# 1600
# 2397
# 2872
# 3828
# 4063
# 4517
# 4555
# 5327
# 5699
# 6104
# 6870
# 7003

Sadly no joy I could not find the interfaces we are looking for. I also could not find them in oleview.

Slion avatar Aug 17 '23 16:08 Slion

Maybe we could locate the DLLs we need and inspect them as suggested here: https://stackoverflow.com/questions/4651869/given-a-com-dll-extract-all-classes-clsid-and-corresponding-interface-name or just using oleview.

Path to oleview.exe, make sure you run it as admin: C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x64

Slion avatar Aug 18 '23 07:08 Slion