1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
| #pragma once
#include "stdafx.h"
#include <objbase.h>
#include <ObjectArray.h>
const CLSID CLSID_ImmersiveShell = {
0xC2F03A33, 0x21F5, 0x47FA, 0xB4, 0xBB, 0x15, 0x63, 0x62, 0xA2, 0xF2, 0x39 };
const CLSID CLSID_VirtualDesktopAPI_Unknown = {
0xC5E0CDCA, 0x7B6E, 0x41B2, 0x9F, 0xC4, 0xD9, 0x39, 0x75, 0xCC, 0x46, 0x7B };
const IID IID_IVirtualDesktopManagerInternal = {
0xEF9F1A6C, 0xD3CC, 0x4358, 0xB7, 0x12, 0xF8, 0x4B, 0x63, 0x5B, 0xEB, 0xE7 };
const CLSID CLSID_IVirtualNotificationService = {
0xA501FDEC, 0x4A09, 0x464C, 0xAE, 0x4E, 0x1B, 0x9C, 0x21, 0xB8, 0x49, 0x18 };
// см. IApplicationView из Windows Runtime
struct IApplicationView : public IUnknown
{
public:
};
// Виртуальный стол
EXTERN_C const IID IID_IVirtualDesktop;
MIDL_INTERFACE("FF72FFDD-BE7E-43FC-9C03-AD81681E88E4")
IVirtualDesktop : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE IsViewVisible(
IApplicationView *pView,
int *pfVisible) = 0;
virtual HRESULT STDMETHODCALLTYPE GetID(
GUID *pGuid) = 0;
};
enum AdjacentDesktop
{
// Соседний рабочий стол слева
LeftDirection = 3,
// Соседний рабочий стол справа
RightDirection = 4
};
// Менеджер виртуальных столов
EXTERN_C const IID IID_IVirtualDesktopManagerInternal;
// 10130
//MIDL_INTERFACE("EF9F1A6C-D3CC-4358-B712-F84B635BEBE7")
// 10240
MIDL_INTERFACE("AF8DA486-95BB-4460-B3B7-6E7A6B2962B5")
IVirtualDesktopManagerInternal : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE GetCount(
UINT *pCount) = 0;
virtual HRESULT STDMETHODCALLTYPE MoveViewToDesktop(
IApplicationView *pView,
IVirtualDesktop *pDesktop) = 0;
// 10240
virtual HRESULT STDMETHODCALLTYPE CanViewMoveDesktops(
IApplicationView *pView,
int *pfCanViewMoveDesktops) = 0;
virtual HRESULT STDMETHODCALLTYPE GetCurrentDesktop(
IVirtualDesktop** desktop) = 0;
virtual HRESULT STDMETHODCALLTYPE GetDesktops(
IObjectArray **ppDesktops) = 0;
// Получение соседнего рабочего стола относительно указанного, с учетом направления
virtual HRESULT STDMETHODCALLTYPE GetAdjacentDesktop(
IVirtualDesktop *pDesktopReference,
AdjacentDesktop uDirection,
IVirtualDesktop **ppAdjacentDesktop) = 0;
virtual HRESULT STDMETHODCALLTYPE SwitchDesktop(
IVirtualDesktop *pDesktop) = 0;
virtual HRESULT STDMETHODCALLTYPE CreateDesktopW(
IVirtualDesktop **ppNewDesktop) = 0;
// pFallbackDesktop - рабочий стол на который будет совершен переход после удаления указанного
virtual HRESULT STDMETHODCALLTYPE RemoveDesktop(
IVirtualDesktop *pRemove,
IVirtualDesktop *pFallbackDesktop) = 0;
// 10240
virtual HRESULT STDMETHODCALLTYPE FindDesktop(
GUID *desktopId,
IVirtualDesktop **ppDesktop) = 0;
};
EXTERN_C const IID IID_IVirtualDesktopManager;
MIDL_INTERFACE("a5cd92ff-29be-454c-8d04-d82879fb3f1b")
IVirtualDesktopManager : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE IsWindowOnCurrentVirtualDesktop(
/* [in] */ __RPC__in HWND topLevelWindow,
/* [out] */ __RPC__out BOOL *onCurrentDesktop) = 0;
virtual HRESULT STDMETHODCALLTYPE GetWindowDesktopId(
/* [in] */ __RPC__in HWND topLevelWindow,
/* [out] */ __RPC__out GUID *desktopId) = 0;
virtual HRESULT STDMETHODCALLTYPE MoveWindowToDesktop(
/* [in] */ __RPC__in HWND topLevelWindow,
/* [in] */ __RPC__in REFGUID desktopId) = 0;
};
EXTERN_C const IID IID_IVirtualDesktopNotification;
MIDL_INTERFACE("C179334C-4295-40D3-BEA1-C654D965605A")
IVirtualDesktopNotification : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE VirtualDesktopCreated(
IVirtualDesktop *pDesktop) = 0;
virtual HRESULT STDMETHODCALLTYPE VirtualDesktopDestroyBegin(
IVirtualDesktop *pDesktopDestroyed,
IVirtualDesktop *pDesktopFallback) = 0;
virtual HRESULT STDMETHODCALLTYPE VirtualDesktopDestroyFailed(
IVirtualDesktop *pDesktopDestroyed,
IVirtualDesktop *pDesktopFallback) = 0;
virtual HRESULT STDMETHODCALLTYPE VirtualDesktopDestroyed(
IVirtualDesktop *pDesktopDestroyed,
IVirtualDesktop *pDesktopFallback) = 0;
virtual HRESULT STDMETHODCALLTYPE ViewVirtualDesktopChanged(
IApplicationView *pView) = 0;
virtual HRESULT STDMETHODCALLTYPE CurrentVirtualDesktopChanged(
IVirtualDesktop *pDesktopOld,
IVirtualDesktop *pDesktopNew) = 0;
};
EXTERN_C const IID IID_IVirtualDesktopNotificationService;
MIDL_INTERFACE("0CD45E71-D927-4F15-8B0A-8FEF525337BF")
IVirtualDesktopNotificationService : public IUnknown
{
public:
virtual HRESULT STDMETHODCALLTYPE Register(
IVirtualDesktopNotification *pNotification,
DWORD *pdwCookie) = 0;
virtual HRESULT STDMETHODCALLTYPE Unregister(
DWORD dwCookie) = 0;
}; |