モノトーンの伝説日記

Apex Legends, Splatoon, Programming, and so on...

Windows 10 の仮想デスクトップ関連 API について,21H2 で変更が入ります

 一応メモもかねて。

 動作検証はしていません。これから実装も含め検討します。整理を兼ねてとりあえず公開記事に。

 また,リオーダー機能や仮想デスクトップごとの壁紙変更機能については公式 Insider Blog をご覧ください。

blogs.windows.com

1. 検証結果

 各種 Windows 10 を遡れる最大限の Build 20231 まで遡った(20226 などそれ以前のバージョンは不可能だった)。

 下線は検証済みのバージョン。

  • Build 〜20206: 旧インターフェース郡
  • Build 20211~20226: 不明(調べる方法がない)
  • Build 20231, 20236, 20241, 20246, 20251, 20257, 20262, 20270, 20277/21277, 20279: インターフェースの変更
  • Build 21313, 21318, 21322, 21327, 21332: 新しいインターフェースの採用 (正式バージョンにも採用見込み)
  • Build 21337, 21343, 21354: reorder などの設定 UI に対応
  • Build 21359, 21364, 21370, 21370, 21376, 21382, 21387, 21390: 通知機能の変更(具体的な追加機能は調査中)

2. Build 9879~20206

 Major = 6, minor = 4 の時代の Build 9879 から追加されたと思われる API 群ですね。少なくとも 10240 では既に登場し,使われていた API は少しだけ拡張され,今の 20H1 にも使われるものになっています。一応整理の意味も込めてこちらのインターフェース軍も載せておきます。IID に関しては OS バージョンによって異なるため,動的にそのシステムからとったほうが良いです。

IVirtualDesktop

  [ComImport]
  [Guid("00000000-0000-0000-0000-000000000000")] // 適宜変更
  [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
  public interface IVirtualDesktop
  {
    [return: MarshalAs(UnmanagedType.Bool)]
    bool IsViewVisible([In] object pView); // HRESULT Proc3([In] IApplicationView* p0, [Out] int* p1);

    Guid GetID(); // HRESULT Proc4([Out] GUID* p0);
  }
  [ComImport]
  [Guid("00000000-0000-0000-0000-000000000000")] // 適宜変更
  [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
  public interface IVirtualDesktop2
  {
    // IVirtualDesktop のすべての関数

    [return: MarshalAs(UnmanagedType.HString)]
    string GetName(); // HRESULT Proc7([Out] HSTRING* p0);
  }

IVirtualDesktopManagerInternal

  [ComImport]
  [Guid("00000000-0000-0000-0000-000000000000")] // 適宜変更
  [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
  public interface IVirtualDesktopManagerInternal
  {
    int GetCount();
      // HRESULT Proc3([Out] int* p1);

    void MoveViewToDesktop(IApplicationView pView, IVirtualDesktop desktop);
      // HRESULT Proc4([In] IApplicationView* p0, [In] IVirtualDesktop* p1);

    [return: MarshalAs(UnmanagedType.Bool)]
    bool CanViewMoveDesktops(IApplicationView pView);
      // HRESULT Proc5([In] IApplicationView* p0, [Out] int* p1);

    IVirtualDesktop GetCurrentDesktop();
      // HRESULT Proc6([Out] IVirtualDesktop** p1);

    IObjectArray GetDesktops();
      // HRESULT Proc7([Out] IObjectArray** p1);

    IVirtualDesktop GetAdjacentDesktop(IVirtualDesktop pDesktopReference, AdjacentDesktop uDirection);
      // HRESULT Proc8([In] IVirtualDesktop* p0, [In] int p1, [Out] IVirtualDesktop** p2);

    void SwitchDesktop(IVirtualDesktop desktop);
      // HRESULT Proc9([In] IVirtualDesktop* p1);

    IVirtualDesktop CreateDesktopW();
      // HRESULT Proc10([Out] IVirtualDesktop** p1);

    void RemoveDesktop(IVirtualDesktop pRemove, IVirtualDesktop pFallbackDesktop);
      // HRESULT Proc11([In] IVirtualDesktop* p0, [In] IVirtualDesktop* p1);

    IVirtualDesktop FindDesktop([In, MarshalAs(UnmanagedType.LPStruct)] Guid desktopId);
      // HRESULT Proc12([In] GUID* p0, [Out] IVirtualDesktop** p1);
  }
  [ComImport]
  [Guid("00000000-0000-0000-0000-000000000000")] // 適宜変更
  [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
  public interface IVirtualDesktopManagerInternal2
  {
    // IVirtualDesktopManagerInternal のすべての関数

    void Unknown1(IVirtualDesktop desktop, out IObjectArray unknown1, out IObjectArray unknown2);
      // HRESULT Proc13([In] IVirtualDesktop* p0, [Out] IObjectArray** p1, [Out] IObjectArray** p2);

    void SetName(IVirtualDesktop desktop, [MarshalAs(UnmanagedType.HString)] string name);
      // HRESULT Proc14([In] IVirtualDesktop* p0, [In] HSTRING p1);
  }
  [ComImport]
  [Guid("00000000-0000-0000-0000-000000000000")] // 適宜変更
  [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
  public interface IVirtualDesktopManagerInternal3
  {
    // IVirtualDesktopManagerInternal2 のすべての関数

    void Unknown2(IApplicationView pView0, IApplicationView  pView1);
      // HRESULT Proc15([In] IApplicationView* p0, [In] IApplicationView* p1);
  }

IVirtualDesktopNotification

  [ComImport]
  [Guid("00000000-0000-0000-0000-000000000000")] // 適宜変更
  [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
  public interface IVirtualDesktopNotification 
  {
    void VirtualDesktopCreated(IVirtualDesktop pDesktop);
      // HRESULT Proc3([In] IVirtualDesktop* p0);

    void VirtualDesktopDestroyBegin(IVirtualDesktop pDesktopDestroyed, IVirtualDesktop pDesktopFallback);
      // HRESULT Proc4([In] IVirtualDesktop* p0, [In] IVirtualDesktop* p1);

    void VirtualDesktopDestroyFailed(IVirtualDesktop pDesktopDestroyed, IVirtualDesktop pDesktopFallback);
      // HRESULT Proc5([In] IVirtualDesktop* p0, [In] IVirtualDesktop* p1);

    void VirtualDesktopDestroyed(IVirtualDesktop pDesktopDestroyed, IVirtualDesktop pDesktopFallback);
      // HRESULT Proc6([In] IVirtualDesktop* p0, [In] IVirtualDesktop* p1);

    void ViewVirtualDesktopChanged(IApplicationView pView);
      // HRESULT Proc7([In] IApplicationView* p0);

    void CurrentVirtualDesktopChanged(IVirtualDesktop pDesktopOld, IVirtualDesktop pDesktopNew);
      // HRESULT Proc8([In] IVirtualDesktop* p0, [In] IVirtualDesktop* p1);
  }
  [ComImport]
  [Guid("00000000-0000-0000-0000-000000000000")] // 適宜変更
  [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
  public interface IVirtualDesktopNotification2
  {
    // IVirtualDesktopNotification のすべての関数

    void VirtualDesktopRenamed(IVirtualDesktop pDesktop, [MarshalAs(UnmanagedType.HString)] string chName);
      // HRESULT Proc9([In] IVirtualDesktop* p0, [In] HSTRING p1);
  }

3. Build 20231~20279, 21277

 一度改変されたものです。こちらのバージョンでも動作確認していますが,Insider Preview でしか使えないものであるため,個人アプリでの対応は不要だと思われます。一応ミドルウェアに当たる Virtual Desktop に PR 投げるために作っているため厳密に調べましたが。

 このバージョンでは 32-bit では HWND, 64-bit では HMONITOR と表示されています。そのため,もしかしたらディスプレイごとに制御できるようになっているのか,あるいは将来のバージョンでディスプレイごとに仮想デスクトップを変えられるようにする意図があるのかもしれません。

 こちらは問題なく動作しました。IntPtr 型のところは IntPtr.Zero 入力すれば OK です。

IVirtualDesktop

  [ComImport]
  [Guid("c863f05a-1378-4f55-9f8c-6b4c00ea03fc")] // Build 20231, 20236
  [Guid("62fdf88b-11ca-4afb-8bd8-2296dfae49e2")] // Build 20241, 20279
  [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
  public interface IVirtualDesktop
  {
    [return: MarshalAs(UnmanagedType.Bool)]
    bool IsViewVisible([In] object pView); // HRESULT Proc3([In] IApplicationView* p0, [Out] int* p1);

    Guid GetID(); // HRESULT Proc4([Out] GUID* p0);

    IntPtr Unknown1(); // HRESULT Proc5([Out] HWND/HMONITOR* p0);

    [return: MarshalAs(UnmanagedType.HString)]
    string GetName(); // HRESULT Proc7([Out] HSTRING* p0);
  }

IVirtualDesktopManagerInternal

  [ComImport]
  [Guid("b1ad6220-8b03-4345-b9fd-d8e6a8baabab")] // Build 20231, 20236
  [Guid("094afe11-44f2-4ba0-976f-29a97e263ee0")] // Build 20241, 20279
  [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
  public interface IVirtualDesktopManagerInternal
  {
    int GetCount(IntPtr hWndOrMon);
      // HRESULT Proc3([In] HWND/HMONITOR p0, [Out] int* p1);

    void MoveViewToDesktop(IApplicationView pView, IVirtualDesktop desktop);
      // HRESULT Proc4([In] IApplicationView* p0, [In] IVirtualDesktop* p1);

    [return: MarshalAs(UnmanagedType.Bool)]
    bool CanViewMoveDesktops(IApplicationView pView);
      // HRESULT Proc5([In] IApplicationView* p0, [Out] int* p1);

    IVirtualDesktop GetCurrentDesktop(IntPtr hWndOrMon);
      // HRESULT Proc6([In] HWND/HMONITOR p0, [Out] IVirtualDesktop** p1);

    IObjectArray GetDesktops(IntPtr hWndOrMon);
      // HRESULT Proc7([In] HWND/HMONITOR p0, [Out] IObjectArray** p1);

    IVirtualDesktop GetAdjacentDesktop(IVirtualDesktop pDesktopReference, AdjacentDesktop uDirection);
      // HRESULT Proc8([In] IVirtualDesktop* p0, [In] int p1, [Out] IVirtualDesktop** p2);

    void SwitchDesktop(IntPtr hWndOrMon, IVirtualDesktop desktop);
      // HRESULT Proc9([In] HWND/HMONITOR  p0, [In] IVirtualDesktop* p1);

    IVirtualDesktop CreateDesktopW(IntPtr hWndOrMon);
      // HRESULT Proc10([In] HWND/HMONITOR p0, [Out] IVirtualDesktop** p1);

    void RemoveDesktop(IVirtualDesktop pRemove, IVirtualDesktop pFallbackDesktop);
      // HRESULT Proc11([In] IVirtualDesktop* p0, [In] IVirtualDesktop* p1);

    IVirtualDesktop FindDesktop([In, MarshalAs(UnmanagedType.LPStruct)] Guid desktopId);
      // HRESULT Proc12([In] GUID* p0, [Out] IVirtualDesktop** p1);

    void Unknown1(IVirtualDesktop desktop, out IObjectArray unknown1, out IObjectArray unknown2);
      // HRESULT Proc13([In] IVirtualDesktop* p0, [Out] IObjectArray** p1, [Out] IObjectArray** p2);

    void SetName(IVirtualDesktop desktop, [MarshalAs(UnmanagedType.HString)] string name);
      // HRESULT Proc14([In] IVirtualDesktop* p0, [In] HSTRING p1);

    void Unknown2(IApplicationView pView0, IApplicationView pView1);
      // HRESULT Proc15([In] IApplicationView* p0, [In] IApplicationView* p1);

    int Unknown3(); // HRESULT Proc16([Out] int* p0);
  }

IVirtualDesktopNotification

  [ComImport]
  [Guid("5dafee84-f7d9-4cd1-b646-64afc9ea4e22")] // Build 20231, 20236
  [Guid("f3163e11-6b04-433c-a64b-6f82c9094257")] // Build 20241, 20279
  [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
  public interface IVirtualDesktopNotification 
  {
    void VirtualDesktopCreated(IVirtualDesktop pDesktop);
      // HRESULT Proc3([In] IVirtualDesktop* p0);

    void VirtualDesktopDestroyBegin(IVirtualDesktop pDesktopDestroyed, IVirtualDesktop pDesktopFallback);
      // HRESULT Proc4([In] IVirtualDesktop* p0, [In] IVirtualDesktop* p1);

    void VirtualDesktopDestroyFailed(IVirtualDesktop pDesktopDestroyed, IVirtualDesktop pDesktopFallback);
      // HRESULT Proc5([In] IVirtualDesktop* p0, [In] IVirtualDesktop* p1);

    void VirtualDesktopDestroyed(IVirtualDesktop pDesktopDestroyed, IVirtualDesktop pDesktopFallback);
      // HRESULT Proc6([In] IVirtualDesktop* p0, [In] IVirtualDesktop* p1);

    void Unknown1(int nNumber); // HRESULT Proc7([In] int p0);

    void VirtualDesktopRenamed(IVirtualDesktop pDesktop, [MarshalAs(UnmanagedType.HString)] string chName);
      // HRESULT Proc8([In] IVirtualDesktop* p0, [In] HSTRING p1);

    void ViewVirtualDesktopChanged(IApplicationView pView);
      // HRESULT Proc9([In] IApplicationView* p0);

    void CurrentVirtualDesktopChanged(IVirtualDesktop pDesktopOld, IVirtualDesktop pDesktopNew);
      // HRESULT Proc10([In] IVirtualDesktop* p0, [In] IVirtualDesktop* p1);
  }

4. Build 21313~21354

IVirtualDesktop

  • Proc5 が IVirtualDesktop から直接 HWND (そのウィンドウハンドルの実態) をとれる関数?
  • Proc6 が仮想デスクトップ名をとれる関数。
  • Proc7 が仮想デスクトップの壁紙のパスをとれる関数。
  [ComImport]
  [Guid("536d3495-b208-4cc9-ae26-de8111275bf8")]
  [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
  public interface IVirtualDesktop
  {
    [return: MarshalAs(UnmanagedType.Bool)]
    bool IsViewVisible([In] object pView); // HRESULT Proc3([In] IApplicationView* p0, [Out] int* p1);

    Guid GetID(); // HRESULT Proc4([Out] GUID* p0);

    IntPtr Unknown1(); // HRESULT Proc5([Out] HWND* p0);

    [return: MarshalAs(UnmanagedType.HString)]
    string GetName(); // HRESULT Proc6([Out] HSTRING* p0);

    [return: MarshalAs(UnmanagedType.HString)]
    string GetWallpaperPath(); // HRESULT Proc7([Out] HSTRING* p0);
  }

IVirtualDesktopManagerInternal

  • Proc11 が仮想デスクトップを移動する関数(nIndex は一番左を 0 としたときの移動先インデックス)。
  [ComImport]
  [Guid("b2f925b9-5a0f-4d2e-9f4d-2b1507593c10")]
  [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
  public interface IVirtualDesktopManagerInternal
  {
    int GetCount(IntPtr hWnd);
      // HRESULT Proc3([In] HWND p0, [Out] int* p1);

    void MoveViewToDesktop(IApplicationView pView, IVirtualDesktop desktop);
      // HRESULT Proc4([In] IApplicationView* p0, [In] IVirtualDesktop* p1);

    [return: MarshalAs(UnmanagedType.Bool)]
    bool CanViewMoveDesktops(IApplicationView pView);
      // HRESULT Proc5([In] IApplicationView* p0, [Out] int* p1);

    IVirtualDesktop GetCurrentDesktop(IntPtr hWnd);
      // HRESULT Proc6([In] HWND p0, [Out] IVirtualDesktop** p1);

    IObjectArray GetDesktops(IntPtr hWnd);
      // HRESULT Proc7([In] HWND p0, [Out] IObjectArray** p1);

    IVirtualDesktop GetAdjacentDesktop(IVirtualDesktop pDesktopReference, AdjacentDesktop uDirection);
      // HRESULT Proc8([In] IVirtualDesktop* p0, [In] int p1, [Out] IVirtualDesktop** p2);

    void SwitchDesktop(IntPtr hWnd, IVirtualDesktop desktop);
      // HRESULT Proc9([In] HWND p0, [In] IVirtualDesktop* p1);

    IVirtualDesktop CreateDesktopW(IntPtr hWnd);
      // HRESULT Proc10([In] HWND p0, [Out] IVirtualDesktop** p1);

    void MoveDesktop(IVirtualDesktop pDesktop, IntPtr hWnd, int nIndex);
      // HRESULT Proc11([In] IVirtualDesktop* p0, [In] HWND p1, [In] int p2);

    void RemoveDesktop(IVirtualDesktop pRemove, IVirtualDesktop pFallbackDesktop);
      // HRESULT Proc12([In] IVirtualDesktop* p0, [In] IVirtualDesktop* p1);

    IVirtualDesktop FindDesktop([In, MarshalAs(UnmanagedType.LPStruct)] Guid desktopId);
      // HRESULT Proc13([In] GUID* p0, [Out] IVirtualDesktop** p1);

    void Unknown1(IVirtualDesktop desktop, out IObjectArray pUnknown1, out IObjectArray pUnknown2);
      // HRESULT Proc14([In] IVirtualDesktop* p0, [Out] IObjectArray** p1, [Out] IObjectArray** p2);

    void Unknown2(IVirtualDesktop desktop, [MarshalAs(UnmanagedType.HString)] string name);
      // HRESULT Proc15([In] IVirtualDesktop* p0, [In] HSTRING p1);

    void SetName(IVirtualDesktop desktop, [MarshalAs(UnmanagedType.HString)] string name);
      // HRESULT Proc16([In] IVirtualDesktop* p0, [In] HSTRING p1);

    void SetWallpaperPath(IVirtualDesktop pDesktop, [MarshalAs(UnmanagedType.HString)] string chPath);
      // HRESULT Proc17([In] HSTRING p0);

    void Unknown3(IApplicationView pView0, IApplicationView  pView1);
      // HRESULT Proc18([In] IApplicationView* p0, [In] IApplicationView* p1);

    int Unknown4(); // HRESULT Proc19([Out] int* p0);
  }

IVirtualDesktopNotification

  [ComImport]
  [Guid("cd403e52-deed-4c13-b437-b98380f2b1e8")]
  [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
  public interface IVirtualDesktopNotification 
  {
    void VirtualDesktopCreated(IVirtualDesktop pDesktop);
      // HRESULT Proc3([In] IVirtualDesktop* p0);

    void VirtualDesktopDestroyBegin(IVirtualDesktop pDesktopDestroyed, IVirtualDesktop pDesktopFallback);
      // HRESULT Proc4([In] IVirtualDesktop* p0, [In] IVirtualDesktop* p1);

    void VirtualDesktopDestroyFailed(IVirtualDesktop pDesktopDestroyed, IVirtualDesktop pDesktopFallback);
      // HRESULT Proc5([In] IVirtualDesktop* p0, [In] IVirtualDesktop* p1);

    void VirtualDesktopDestroyed(IVirtualDesktop pDesktopDestroyed, IVirtualDesktop pDesktopFallback);
      // HRESULT Proc6([In] IVirtualDesktop* p0, [In] IVirtualDesktop* p1);

    void Unknown1(int nNumber); // HRESULT Proc7([In] int p0);

    void VirtualDesktopMoved(IVirtualDesktop pDesktop, int nFromIndex, int nToIndex);
      // HRESULT Proc8([In] IVirtualDesktop* p0, [In] int p1, [In] int p2);

    void VirtualDesktopRenamed(IVirtualDesktop pDesktop, [MarshalAs(UnmanagedType.HString)] string chText);
      // HRESULT Proc9([In] IVirtualDesktop* p0, [In] HSTRING p1);

    void ViewVirtualDesktopChanged(IApplicationView pView);
      // HRESULT Proc10([In] IApplicationView* p0);

    void CurrentVirtualDesktopChanged(IVirtualDesktop pDesktopOld, IVirtualDesktop pDesktopNew);
      // HRESULT Proc11([In] IVirtualDesktop* p0, [In] IVirtualDesktop* p1);

    void VirtualDesktopWallpaperChanged(IVirtualDesktop pDesktop, [MarshalAs(UnmanagedType.HString)] string chPath);
      // HRESULT Proc12([In] IVirtualDesktop* p0, [In] HSTRING p1);
  }

5. Build 21359 以上

 GitHub にこんなコメントがついてました。

https://github.com/Grabacr07/VirtualDesktop/pull/57#issuecomment-862921222

 おそらくインターフェースが変更されたと思ったので、手持ちの Build 21354 から Windows Update で Build 21387 に上げました。そのため、調査しているバージョンは Build 21387 になります。

 ちなみに、GUID は変更がない模様。

IVirtualDesktop

 変更なし。

IVirtualDesktopManagerInternal

  • Proc20 の引数 int p0 をもつ関数が追加される。
  [ComImport]
  [Guid("b2f925b9-5a0f-4d2e-9f4d-2b1507593c10")]
  [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
  public interface IVirtualDesktopManagerInternal
  {
    int GetCount(IntPtr hWnd);
      // HRESULT Proc3([In] HWND p0, [Out] int* p1);

    void MoveViewToDesktop(IApplicationView pView, IVirtualDesktop desktop);
      // HRESULT Proc4([In] IApplicationView* p0, [In] IVirtualDesktop* p1);

    [return: MarshalAs(UnmanagedType.Bool)]
    bool CanViewMoveDesktops(IApplicationView pView);
      // HRESULT Proc5([In] IApplicationView* p0, [Out] int* p1);

    IVirtualDesktop GetCurrentDesktop(IntPtr hWnd);
      // HRESULT Proc6([In] HWND p0, [Out] IVirtualDesktop** p1);

    IObjectArray GetDesktops(IntPtr hWnd);
      // HRESULT Proc7([In] HWND p0, [Out] IObjectArray** p1);

    IVirtualDesktop GetAdjacentDesktop(IVirtualDesktop pDesktopReference, AdjacentDesktop uDirection);
      // HRESULT Proc8([In] IVirtualDesktop* p0, [In] int p1, [Out] IVirtualDesktop** p2);

    void SwitchDesktop(IntPtr hWnd, IVirtualDesktop desktop);
      // HRESULT Proc9([In] HWND p0, [In] IVirtualDesktop* p1);

    IVirtualDesktop CreateDesktopW(IntPtr hWnd);
      // HRESULT Proc10([In] HWND p0, [Out] IVirtualDesktop** p1);

    void MoveDesktop(IVirtualDesktop pDesktop, IntPtr hWnd, int nIndex);
      // HRESULT Proc11([In] IVirtualDesktop* p0, [In] HWND p1, [In] int p2);

    void RemoveDesktop(IVirtualDesktop pRemove, IVirtualDesktop pFallbackDesktop);
      // HRESULT Proc12([In] IVirtualDesktop* p0, [In] IVirtualDesktop* p1);

    IVirtualDesktop FindDesktop([In, MarshalAs(UnmanagedType.LPStruct)] Guid desktopId);
      // HRESULT Proc13([In] GUID* p0, [Out] IVirtualDesktop** p1);

    void Unknown1(IVirtualDesktop desktop, out IObjectArray pUnknown1, out IObjectArray pUnknown2);
      // HRESULT Proc14([In] IVirtualDesktop* p0, [Out] IObjectArray** p1, [Out] IObjectArray** p2);

    void Unknown2(IVirtualDesktop desktop, [MarshalAs(UnmanagedType.HString)] string name);
      // HRESULT Proc15([In] IVirtualDesktop* p0, [In] HSTRING p1);

    void SetName(IVirtualDesktop desktop, [MarshalAs(UnmanagedType.HString)] string name);
      // HRESULT Proc16([In] IVirtualDesktop* p0, [In] HSTRING p1);

    void SetWallpaperPath(IVirtualDesktop pDesktop, [MarshalAs(UnmanagedType.HString)] string chPath);
      // HRESULT Proc17([In] HSTRING p0);

    void Unknown3(IApplicationView pView0, IApplicationView  pView1);
      // HRESULT Proc18([In] IApplicationView* p0, [In] IApplicationView* p1);

    int Unknown4(); // HRESULT Proc19([Out] int* p0);

    void Unknown5(int p0); // HRESULT Proc20([In] int p0);
  }

IVirtualDesktopNotification

  • IObjectArray が引数として追加されています。
  [ComImport]
  [Guid("cd403e52-deed-4c13-b437-b98380f2b1e8")]
  [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
  public interface IVirtualDesktopNotification 
  {
    void VirtualDesktopCreated(IObjectArray p0, IVirtualDesktop pDesktop);
      // HRESULT Proc3([In] IObjectArray* p0, [In] IVirtualDesktop* p1);

    void VirtualDesktopDestroyBegin(IObjectArray p0, IVirtualDesktop pDesktopDestroyed, IVirtualDesktop pDesktopFallback);
      // HRESULT Proc4([In] IObjectArray* p0, [In] IVirtualDesktop* p1, [In] IVirtualDesktop* p2);

    void VirtualDesktopDestroyFailed(IObjectArray p0, IVirtualDesktop pDesktopDestroyed, IVirtualDesktop pDesktopFallback);
      // HRESULT Proc5([In] IObjectArray* p0, [In] IVirtualDesktop* p1, [In] IVirtualDesktop* p2);

    void VirtualDesktopDestroyed(IObjectArray p0, IVirtualDesktop pDesktopDestroyed, IVirtualDesktop pDesktopFallback);
      // HRESULT Proc6([In] IObjectArray* p0, [In] IVirtualDesktop* p1, [In] IVirtualDesktop* p2);

    void Unknown1(int nNumber); // HRESULT Proc7([In] int p0);

    void VirtualDesktopMoved(IObjectArray p0, IVirtualDesktop pDesktop, int nFromIndex, int nToIndex);
      // HRESULT Proc8([In] IObjectArray* p0, [In] IVirtualDesktop* p1, [In] int p2, [In] int p3);

    void VirtualDesktopRenamed(IVirtualDesktop pDesktop, [MarshalAs(UnmanagedType.HString)] string chText);
      // HRESULT Proc9([In] IVirtualDesktop* p0, [In] HSTRING p1);

    void ViewVirtualDesktopChanged(IApplicationView pView);
      // HRESULT Proc10([In] IApplicationView* p0);

    void CurrentVirtualDesktopChanged(IObjectArray p0, IVirtualDesktop pDesktopOld, IVirtualDesktop pDesktopNew);
      // HRESULT Proc11([In] IObjectArray* p0, [In] IVirtualDesktop* p1, [In] IVirtualDesktop* p2);

    void VirtualDesktopWallpaperChanged(IVirtualDesktop pDesktop, [MarshalAs(UnmanagedType.HString)] string chPath);
      // HRESULT Proc12([In] IVirtualDesktop* p0, [In] HSTRING p1);
  }

6. 他の気になる interface

IVirtualDesktopAnimationSyncNotification

 例によって,interface ~Service にて登録する形式の interface。

 OleView .NET からのそのままこコピペで申し訳ないですが。

[Guid("6cafd3f1-05d1-4d26-a32a-9907a72c920b")]
interface IVirtualDesktopAnimationSyncNotification : IUnknown {
    HRESULT Proc3(/* Stack Offset: 4 */ [In] IVirtualDesktop* p0, /* Stack Offset: 8 */ [In] IVirtualDesktop* p1);
}

[Guid("0ddaf2d8-c38f-4638-95fc-fb9c6ddae52f")]
interface IVirtualDesktopAnimationSyncNotificationService : IUnknown {
    HRESULT Proc3(/* Stack Offset: 4 */ [In] IVirtualDesktopAnimationSyncNotification* p0, /* Stack Offset: 8 */ [Out] int* p1);
    HRESULT Proc4(/* Stack Offset: 4 */ [In] int p0);
}