-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
progress.h
189 lines (164 loc) · 3.44 KB
/
progress.h
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
#include <initguid.h>
#include <shlobj.h>
HRESULT STDMETHODCALLTYPE QueryInterface(
IFileOperationProgressSink *this,
REFIID riid,
void **ppv
) {
if (riid == &IID_IUnknown || riid == &IID_IFileOperationProgressSink) {
*ppv = this;
return S_OK;
}
*ppv = NULL;
return E_NOINTERFACE;
}
ULONG STDMETHODCALLTYPE AddRef(IFileOperationProgressSink *this) {
return S_OK;
}
ULONG STDMETHODCALLTYPE Release(IFileOperationProgressSink *this) {
return S_OK;
}
HRESULT STDMETHODCALLTYPE StartOperations(IFileOperationProgressSink *this) {
return S_OK;
}
HRESULT STDMETHODCALLTYPE FinishOperations(
IFileOperationProgressSink *this,
HRESULT hrResult
) {
return S_OK;
}
HRESULT STDMETHODCALLTYPE PreRenameItem(
IFileOperationProgressSink *this,
DWORD dwFlags,
IShellItem *psiItem,
LPCWSTR pszNewName
) {
return S_OK;
}
HRESULT STDMETHODCALLTYPE PostRenameItem(
IFileOperationProgressSink *this,
DWORD dwFlags,
IShellItem *psiItem,
LPCWSTR pszNewName,
HRESULT hrRename,
IShellItem *psiNewlyCreated
) {
return S_OK;
}
HRESULT STDMETHODCALLTYPE PreMoveItem(
IFileOperationProgressSink *this,
DWORD dwFlags,
IShellItem *psiItem,
IShellItem *psiDestinationFolder,
LPCWSTR pszNewNam
) {
return S_OK;
}
HRESULT STDMETHODCALLTYPE PostMoveItem(
IFileOperationProgressSink *this,
DWORD dwFlags,
IShellItem *psiItem,
IShellItem *psiDestinationFolder,
LPCWSTR pszNewName,
HRESULT hrMove,
IShellItem *psiNewlyCreated
) {
return S_OK;
}
HRESULT STDMETHODCALLTYPE PreCopyItem(
IFileOperationProgressSink *this,
DWORD dwFlags,
IShellItem *psiItem,
IShellItem *psiDestinationFolder,
LPCWSTR pszNewName
) {
return S_OK;
}
HRESULT STDMETHODCALLTYPE PostCopyItem(
IFileOperationProgressSink *this,
DWORD dwFlags,
IShellItem *psiItem,
IShellItem *psiDestinationFolder,
LPCWSTR pszNewName,
HRESULT hrCopy,
IShellItem *psiNewlyCreated
) {
return S_OK;
}
HRESULT STDMETHODCALLTYPE PreDeleteItem(
IFileOperationProgressSink *this,
DWORD dwFlags,
IShellItem *psiItem
) {
if (dwFlags & TSF_DELETE_RECYCLE_IF_POSSIBLE) {
return S_OK;
}
return E_ABORT;
}
HRESULT STDMETHODCALLTYPE PostDeleteItem(
IFileOperationProgressSink *this,
DWORD dwFlags,
IShellItem *psiItem,
HRESULT hrDelete,
IShellItem *psiNewlyCreated
) {
return S_OK;
}
HRESULT STDMETHODCALLTYPE PreNewItem(
IFileOperationProgressSink *this,
DWORD dwFlags,
IShellItem *psiDestinationFolder,
LPCWSTR pszNewName
) {
return S_OK;
}
HRESULT STDMETHODCALLTYPE PostNewItem(
IFileOperationProgressSink *this,
DWORD dwFlags,
IShellItem *psiDestinationFolder,
LPCWSTR pszNewName,
LPCWSTR pszTemplateName,
DWORD dwFileAttributes,
HRESULT hrNew,
IShellItem *psiNewItem
) {
return S_OK;
}
HRESULT STDMETHODCALLTYPE UpdateProgress(
IFileOperationProgressSink *this,
UINT iWorkTotal,
UINT iWorkSoFar
) {
return S_OK;
}
HRESULT STDMETHODCALLTYPE ResetTimer(IFileOperationProgressSink *this) {
return S_OK;
}
HRESULT STDMETHODCALLTYPE PauseTimer(IFileOperationProgressSink *this) {
return S_OK;
}
HRESULT STDMETHODCALLTYPE ResumeTimer(IFileOperationProgressSink *this) {
return S_OK;
}
static IFileOperationProgressSinkVtbl progressSinkVtbl = {
QueryInterface,
AddRef,
Release,
StartOperations,
FinishOperations,
PreRenameItem,
PostRenameItem,
PreMoveItem,
PostMoveItem,
PreCopyItem,
PostCopyItem,
PreDeleteItem,
PostDeleteItem,
PreNewItem,
PostNewItem,
UpdateProgress,
ResetTimer,
PauseTimer,
ResumeTimer
};
static IFileOperationProgressSink progressSink = { &progressSinkVtbl };