Statistics
| Branch: | Revision:

root / trunk / Pithos.Client.WPF / NativeMethods.cs @ f2d88248

History | View | Annotate | Download (14.2 kB)

1 255f5f86 Panagiotis Kanavos
#region
2 255f5f86 Panagiotis Kanavos
/* -----------------------------------------------------------------------
3 255f5f86 Panagiotis Kanavos
 * <copyright file="NativeMethods.cs" company="GRNet">
4 255f5f86 Panagiotis Kanavos
 * 
5 255f5f86 Panagiotis Kanavos
 * Copyright 2011-2012 GRNET S.A. All rights reserved.
6 255f5f86 Panagiotis Kanavos
 *
7 255f5f86 Panagiotis Kanavos
 * Redistribution and use in source and binary forms, with or
8 255f5f86 Panagiotis Kanavos
 * without modification, are permitted provided that the following
9 255f5f86 Panagiotis Kanavos
 * conditions are met:
10 255f5f86 Panagiotis Kanavos
 *
11 255f5f86 Panagiotis Kanavos
 *   1. Redistributions of source code must retain the above
12 255f5f86 Panagiotis Kanavos
 *      copyright notice, this list of conditions and the following
13 255f5f86 Panagiotis Kanavos
 *      disclaimer.
14 255f5f86 Panagiotis Kanavos
 *
15 255f5f86 Panagiotis Kanavos
 *   2. Redistributions in binary form must reproduce the above
16 255f5f86 Panagiotis Kanavos
 *      copyright notice, this list of conditions and the following
17 255f5f86 Panagiotis Kanavos
 *      disclaimer in the documentation and/or other materials
18 255f5f86 Panagiotis Kanavos
 *      provided with the distribution.
19 255f5f86 Panagiotis Kanavos
 *
20 255f5f86 Panagiotis Kanavos
 *
21 255f5f86 Panagiotis Kanavos
 * THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
22 255f5f86 Panagiotis Kanavos
 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
23 255f5f86 Panagiotis Kanavos
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24 255f5f86 Panagiotis Kanavos
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
25 255f5f86 Panagiotis Kanavos
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 255f5f86 Panagiotis Kanavos
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 255f5f86 Panagiotis Kanavos
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
28 255f5f86 Panagiotis Kanavos
 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
29 255f5f86 Panagiotis Kanavos
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 255f5f86 Panagiotis Kanavos
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 255f5f86 Panagiotis Kanavos
 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 255f5f86 Panagiotis Kanavos
 * POSSIBILITY OF SUCH DAMAGE.
33 255f5f86 Panagiotis Kanavos
 *
34 255f5f86 Panagiotis Kanavos
 * The views and conclusions contained in the software and
35 255f5f86 Panagiotis Kanavos
 * documentation are those of the authors and should not be
36 255f5f86 Panagiotis Kanavos
 * interpreted as representing official policies, either expressed
37 255f5f86 Panagiotis Kanavos
 * or implied, of GRNET S.A.
38 255f5f86 Panagiotis Kanavos
 * </copyright>
39 255f5f86 Panagiotis Kanavos
 * -----------------------------------------------------------------------
40 255f5f86 Panagiotis Kanavos
 */
41 255f5f86 Panagiotis Kanavos
#endregion
42 255f5f86 Panagiotis Kanavos
using System;
43 1caef52e Panagiotis Kanavos
using System.Runtime.InteropServices;
44 1caef52e Panagiotis Kanavos
45 1caef52e Panagiotis Kanavos
namespace Pithos.Client.WPF
46 1caef52e Panagiotis Kanavos
{
47 1caef52e Panagiotis Kanavos
    #region Enums & Structs
48 1caef52e Panagiotis Kanavos
49 1caef52e Panagiotis Kanavos
    #region enum HChangeNotifyEventID
50 1caef52e Panagiotis Kanavos
    /// <summary>
51 1caef52e Panagiotis Kanavos
    /// Describes the event that has occurred. 
52 1caef52e Panagiotis Kanavos
    /// Typically, only one event is specified at a time. 
53 1caef52e Panagiotis Kanavos
    /// If more than one event is specified, the values contained 
54 1caef52e Panagiotis Kanavos
    /// in the <i>dwItem1</i> and <i>dwItem2</i> 
55 1caef52e Panagiotis Kanavos
    /// parameters must be the same, respectively, for all specified events. 
56 1caef52e Panagiotis Kanavos
    /// This parameter can be one or more of the following values. 
57 1caef52e Panagiotis Kanavos
    /// </summary>
58 1caef52e Panagiotis Kanavos
    /// <remarks>
59 1caef52e Panagiotis Kanavos
    /// <para><b>Windows NT/2000/XP:</b> <i>dwItem2</i> contains the index 
60 1caef52e Panagiotis Kanavos
    /// in the system image list that has changed. 
61 1caef52e Panagiotis Kanavos
    /// <i>dwItem1</i> is not used and should be <see langword="null"/>.</para>
62 1caef52e Panagiotis Kanavos
    /// <para><b>Windows 95/98:</b> <i>dwItem1</i> contains the index 
63 1caef52e Panagiotis Kanavos
    /// in the system image list that has changed. 
64 1caef52e Panagiotis Kanavos
    /// <i>dwItem2</i> is not used and should be <see langword="null"/>.</para>
65 1caef52e Panagiotis Kanavos
    /// </remarks>
66 1caef52e Panagiotis Kanavos
    [Flags]
67 1caef52e Panagiotis Kanavos
    enum HChangeNotifyEventID
68 1caef52e Panagiotis Kanavos
    {
69 1caef52e Panagiotis Kanavos
        /// <summary>
70 1caef52e Panagiotis Kanavos
        /// All events have occurred. 
71 1caef52e Panagiotis Kanavos
        /// </summary>
72 1caef52e Panagiotis Kanavos
        SHCNE_ALLEVENTS = 0x7FFFFFFF,
73 1caef52e Panagiotis Kanavos
74 1caef52e Panagiotis Kanavos
        /// <summary>
75 1caef52e Panagiotis Kanavos
        /// A file type association has changed. <see cref="HChangeNotifyFlags.SHCNF_IDLIST"/> 
76 1caef52e Panagiotis Kanavos
        /// must be specified in the <i>uFlags</i> parameter. 
77 1caef52e Panagiotis Kanavos
        /// <i>dwItem1</i> and <i>dwItem2</i> are not used and must be <see langword="null"/>. 
78 1caef52e Panagiotis Kanavos
        /// </summary>
79 1caef52e Panagiotis Kanavos
        SHCNE_ASSOCCHANGED = 0x08000000,
80 1caef52e Panagiotis Kanavos
81 1caef52e Panagiotis Kanavos
        /// <summary>
82 1caef52e Panagiotis Kanavos
        /// The attributes of an item or folder have changed. 
83 1caef52e Panagiotis Kanavos
        /// <see cref="HChangeNotifyFlags.SHCNF_IDLIST"/> or 
84 1caef52e Panagiotis Kanavos
        /// <see cref="HChangeNotifyFlags.SHCNF_PATH"/> must be specified in <i>uFlags</i>. 
85 1caef52e Panagiotis Kanavos
        /// <i>dwItem1</i> contains the item or folder that has changed. 
86 1caef52e Panagiotis Kanavos
        /// <i>dwItem2</i> is not used and should be <see langword="null"/>.
87 1caef52e Panagiotis Kanavos
        /// </summary>
88 1caef52e Panagiotis Kanavos
        SHCNE_ATTRIBUTES = 0x00000800,
89 1caef52e Panagiotis Kanavos
90 1caef52e Panagiotis Kanavos
        /// <summary>
91 1caef52e Panagiotis Kanavos
        /// A nonfolder item has been created. 
92 1caef52e Panagiotis Kanavos
        /// <see cref="HChangeNotifyFlags.SHCNF_IDLIST"/> or 
93 1caef52e Panagiotis Kanavos
        /// <see cref="HChangeNotifyFlags.SHCNF_PATH"/> must be specified in <i>uFlags</i>. 
94 1caef52e Panagiotis Kanavos
        /// <i>dwItem1</i> contains the item that was created. 
95 1caef52e Panagiotis Kanavos
        /// <i>dwItem2</i> is not used and should be <see langword="null"/>.
96 1caef52e Panagiotis Kanavos
        /// </summary>
97 1caef52e Panagiotis Kanavos
        SHCNE_CREATE = 0x00000002,
98 1caef52e Panagiotis Kanavos
99 1caef52e Panagiotis Kanavos
        /// <summary>
100 1caef52e Panagiotis Kanavos
        /// A nonfolder item has been deleted. 
101 1caef52e Panagiotis Kanavos
        /// <see cref="HChangeNotifyFlags.SHCNF_IDLIST"/> or 
102 1caef52e Panagiotis Kanavos
        /// <see cref="HChangeNotifyFlags.SHCNF_PATH"/> must be specified in <i>uFlags</i>. 
103 1caef52e Panagiotis Kanavos
        /// <i>dwItem1</i> contains the item that was deleted. 
104 1caef52e Panagiotis Kanavos
        /// <i>dwItem2</i> is not used and should be <see langword="null"/>. 
105 1caef52e Panagiotis Kanavos
        /// </summary>
106 1caef52e Panagiotis Kanavos
        SHCNE_DELETE = 0x00000004,
107 1caef52e Panagiotis Kanavos
108 1caef52e Panagiotis Kanavos
        /// <summary>
109 1caef52e Panagiotis Kanavos
        /// A drive has been added. 
110 1caef52e Panagiotis Kanavos
        /// <see cref="HChangeNotifyFlags.SHCNF_IDLIST"/> or 
111 1caef52e Panagiotis Kanavos
        /// <see cref="HChangeNotifyFlags.SHCNF_PATH"/> must be specified in <i>uFlags</i>. 
112 1caef52e Panagiotis Kanavos
        /// <i>dwItem1</i> contains the root of the drive that was added. 
113 1caef52e Panagiotis Kanavos
        /// <i>dwItem2</i> is not used and should be <see langword="null"/>. 
114 1caef52e Panagiotis Kanavos
        /// </summary>
115 1caef52e Panagiotis Kanavos
        SHCNE_DRIVEADD = 0x00000100,
116 1caef52e Panagiotis Kanavos
117 1caef52e Panagiotis Kanavos
        /// <summary>
118 1caef52e Panagiotis Kanavos
        /// A drive has been added and the Shell should create a new window for the drive. 
119 1caef52e Panagiotis Kanavos
        /// <see cref="HChangeNotifyFlags.SHCNF_IDLIST"/> or 
120 1caef52e Panagiotis Kanavos
        /// <see cref="HChangeNotifyFlags.SHCNF_PATH"/> must be specified in <i>uFlags</i>. 
121 1caef52e Panagiotis Kanavos
        /// <i>dwItem1</i> contains the root of the drive that was added. 
122 1caef52e Panagiotis Kanavos
        /// <i>dwItem2</i> is not used and should be <see langword="null"/>. 
123 1caef52e Panagiotis Kanavos
        /// </summary>
124 1caef52e Panagiotis Kanavos
        SHCNE_DRIVEADDGUI = 0x00010000,
125 1caef52e Panagiotis Kanavos
126 1caef52e Panagiotis Kanavos
        /// <summary>
127 1caef52e Panagiotis Kanavos
        /// A drive has been removed. <see cref="HChangeNotifyFlags.SHCNF_IDLIST"/> or 
128 1caef52e Panagiotis Kanavos
        /// <see cref="HChangeNotifyFlags.SHCNF_PATH"/> must be specified in <i>uFlags</i>. 
129 1caef52e Panagiotis Kanavos
        /// <i>dwItem1</i> contains the root of the drive that was removed.
130 1caef52e Panagiotis Kanavos
        /// <i>dwItem2</i> is not used and should be <see langword="null"/>. 
131 1caef52e Panagiotis Kanavos
        /// </summary>
132 1caef52e Panagiotis Kanavos
        SHCNE_DRIVEREMOVED = 0x00000080,
133 1caef52e Panagiotis Kanavos
134 1caef52e Panagiotis Kanavos
        /// <summary>
135 1caef52e Panagiotis Kanavos
        /// Not currently used. 
136 1caef52e Panagiotis Kanavos
        /// </summary>
137 1caef52e Panagiotis Kanavos
        SHCNE_EXTENDED_EVENT = 0x04000000,
138 1caef52e Panagiotis Kanavos
139 1caef52e Panagiotis Kanavos
        /// <summary>
140 1caef52e Panagiotis Kanavos
        /// The amount of free space on a drive has changed. 
141 1caef52e Panagiotis Kanavos
        /// <see cref="HChangeNotifyFlags.SHCNF_IDLIST"/> or 
142 1caef52e Panagiotis Kanavos
        /// <see cref="HChangeNotifyFlags.SHCNF_PATH"/> must be specified in <i>uFlags</i>. 
143 1caef52e Panagiotis Kanavos
        /// <i>dwItem1</i> contains the root of the drive on which the free space changed.
144 1caef52e Panagiotis Kanavos
        /// <i>dwItem2</i> is not used and should be <see langword="null"/>. 
145 1caef52e Panagiotis Kanavos
        /// </summary>
146 1caef52e Panagiotis Kanavos
        SHCNE_FREESPACE = 0x00040000,
147 1caef52e Panagiotis Kanavos
148 1caef52e Panagiotis Kanavos
        /// <summary>
149 1caef52e Panagiotis Kanavos
        /// Storage media has been inserted into a drive. 
150 1caef52e Panagiotis Kanavos
        /// <see cref="HChangeNotifyFlags.SHCNF_IDLIST"/> or 
151 1caef52e Panagiotis Kanavos
        /// <see cref="HChangeNotifyFlags.SHCNF_PATH"/> must be specified in <i>uFlags</i>. 
152 1caef52e Panagiotis Kanavos
        /// <i>dwItem1</i> contains the root of the drive that contains the new media. 
153 1caef52e Panagiotis Kanavos
        /// <i>dwItem2</i> is not used and should be <see langword="null"/>. 
154 1caef52e Panagiotis Kanavos
        /// </summary>
155 1caef52e Panagiotis Kanavos
        SHCNE_MEDIAINSERTED = 0x00000020,
156 1caef52e Panagiotis Kanavos
157 1caef52e Panagiotis Kanavos
        /// <summary>
158 1caef52e Panagiotis Kanavos
        /// Storage media has been removed from a drive. 
159 1caef52e Panagiotis Kanavos
        /// <see cref="HChangeNotifyFlags.SHCNF_IDLIST"/> or 
160 1caef52e Panagiotis Kanavos
        /// <see cref="HChangeNotifyFlags.SHCNF_PATH"/> must be specified in <i>uFlags</i>. 
161 1caef52e Panagiotis Kanavos
        /// <i>dwItem1</i> contains the root of the drive from which the media was removed. 
162 1caef52e Panagiotis Kanavos
        /// <i>dwItem2</i> is not used and should be <see langword="null"/>. 
163 1caef52e Panagiotis Kanavos
        /// </summary>
164 1caef52e Panagiotis Kanavos
        SHCNE_MEDIAREMOVED = 0x00000040,
165 1caef52e Panagiotis Kanavos
166 1caef52e Panagiotis Kanavos
        /// <summary>
167 1caef52e Panagiotis Kanavos
        /// A folder has been created. <see cref="HChangeNotifyFlags.SHCNF_IDLIST"/> 
168 1caef52e Panagiotis Kanavos
        /// or <see cref="HChangeNotifyFlags.SHCNF_PATH"/> must be specified in <i>uFlags</i>. 
169 1caef52e Panagiotis Kanavos
        /// <i>dwItem1</i> contains the folder that was created. 
170 1caef52e Panagiotis Kanavos
        /// <i>dwItem2</i> is not used and should be <see langword="null"/>. 
171 1caef52e Panagiotis Kanavos
        /// </summary>
172 1caef52e Panagiotis Kanavos
        SHCNE_MKDIR = 0x00000008,
173 1caef52e Panagiotis Kanavos
174 1caef52e Panagiotis Kanavos
        /// <summary>
175 1caef52e Panagiotis Kanavos
        /// A folder on the local computer is being shared via the network. 
176 1caef52e Panagiotis Kanavos
        /// <see cref="HChangeNotifyFlags.SHCNF_IDLIST"/> or 
177 1caef52e Panagiotis Kanavos
        /// <see cref="HChangeNotifyFlags.SHCNF_PATH"/> must be specified in <i>uFlags</i>. 
178 1caef52e Panagiotis Kanavos
        /// <i>dwItem1</i> contains the folder that is being shared. 
179 1caef52e Panagiotis Kanavos
        /// <i>dwItem2</i> is not used and should be <see langword="null"/>. 
180 1caef52e Panagiotis Kanavos
        /// </summary>
181 1caef52e Panagiotis Kanavos
        SHCNE_NETSHARE = 0x00000200,
182 1caef52e Panagiotis Kanavos
183 1caef52e Panagiotis Kanavos
        /// <summary>
184 1caef52e Panagiotis Kanavos
        /// A folder on the local computer is no longer being shared via the network. 
185 1caef52e Panagiotis Kanavos
        /// <see cref="HChangeNotifyFlags.SHCNF_IDLIST"/> or 
186 1caef52e Panagiotis Kanavos
        /// <see cref="HChangeNotifyFlags.SHCNF_PATH"/> must be specified in <i>uFlags</i>. 
187 1caef52e Panagiotis Kanavos
        /// <i>dwItem1</i> contains the folder that is no longer being shared. 
188 1caef52e Panagiotis Kanavos
        /// <i>dwItem2</i> is not used and should be <see langword="null"/>. 
189 1caef52e Panagiotis Kanavos
        /// </summary>
190 1caef52e Panagiotis Kanavos
        SHCNE_NETUNSHARE = 0x00000400,
191 1caef52e Panagiotis Kanavos
192 1caef52e Panagiotis Kanavos
        /// <summary>
193 1caef52e Panagiotis Kanavos
        /// The name of a folder has changed. 
194 1caef52e Panagiotis Kanavos
        /// <see cref="HChangeNotifyFlags.SHCNF_IDLIST"/> or 
195 1caef52e Panagiotis Kanavos
        /// <see cref="HChangeNotifyFlags.SHCNF_PATH"/> must be specified in <i>uFlags</i>. 
196 1caef52e Panagiotis Kanavos
        /// <i>dwItem1</i> contains the previous pointer to an item identifier list (PIDL) or name of the folder. 
197 1caef52e Panagiotis Kanavos
        /// <i>dwItem2</i> contains the new PIDL or name of the folder. 
198 1caef52e Panagiotis Kanavos
        /// </summary>
199 1caef52e Panagiotis Kanavos
        SHCNE_RENAMEFOLDER = 0x00020000,
200 1caef52e Panagiotis Kanavos
201 1caef52e Panagiotis Kanavos
        /// <summary>
202 1caef52e Panagiotis Kanavos
        /// The name of a nonfolder item has changed. 
203 1caef52e Panagiotis Kanavos
        /// <see cref="HChangeNotifyFlags.SHCNF_IDLIST"/> or 
204 1caef52e Panagiotis Kanavos
        /// <see cref="HChangeNotifyFlags.SHCNF_PATH"/> must be specified in <i>uFlags</i>. 
205 1caef52e Panagiotis Kanavos
        /// <i>dwItem1</i> contains the previous PIDL or name of the item. 
206 1caef52e Panagiotis Kanavos
        /// <i>dwItem2</i> contains the new PIDL or name of the item. 
207 1caef52e Panagiotis Kanavos
        /// </summary>
208 1caef52e Panagiotis Kanavos
        SHCNE_RENAMEITEM = 0x00000001,
209 1caef52e Panagiotis Kanavos
210 1caef52e Panagiotis Kanavos
        /// <summary>
211 1caef52e Panagiotis Kanavos
        /// A folder has been removed. 
212 1caef52e Panagiotis Kanavos
        /// <see cref="HChangeNotifyFlags.SHCNF_IDLIST"/> or 
213 1caef52e Panagiotis Kanavos
        /// <see cref="HChangeNotifyFlags.SHCNF_PATH"/> must be specified in <i>uFlags</i>. 
214 1caef52e Panagiotis Kanavos
        /// <i>dwItem1</i> contains the folder that was removed. 
215 1caef52e Panagiotis Kanavos
        /// <i>dwItem2</i> is not used and should be <see langword="null"/>. 
216 1caef52e Panagiotis Kanavos
        /// </summary>
217 1caef52e Panagiotis Kanavos
        SHCNE_RMDIR = 0x00000010,
218 1caef52e Panagiotis Kanavos
219 1caef52e Panagiotis Kanavos
        /// <summary>
220 1caef52e Panagiotis Kanavos
        /// The computer has disconnected from a server. 
221 1caef52e Panagiotis Kanavos
        /// <see cref="HChangeNotifyFlags.SHCNF_IDLIST"/> or 
222 1caef52e Panagiotis Kanavos
        /// <see cref="HChangeNotifyFlags.SHCNF_PATH"/> must be specified in <i>uFlags</i>. 
223 1caef52e Panagiotis Kanavos
        /// <i>dwItem1</i> contains the server from which the computer was disconnected. 
224 1caef52e Panagiotis Kanavos
        /// <i>dwItem2</i> is not used and should be <see langword="null"/>. 
225 1caef52e Panagiotis Kanavos
        /// </summary>
226 1caef52e Panagiotis Kanavos
        SHCNE_SERVERDISCONNECT = 0x00004000,
227 1caef52e Panagiotis Kanavos
228 1caef52e Panagiotis Kanavos
        /// <summary>
229 1caef52e Panagiotis Kanavos
        /// The contents of an existing folder have changed, 
230 1caef52e Panagiotis Kanavos
        /// but the folder still exists and has not been renamed. 
231 1caef52e Panagiotis Kanavos
        /// <see cref="HChangeNotifyFlags.SHCNF_IDLIST"/> or 
232 1caef52e Panagiotis Kanavos
        /// <see cref="HChangeNotifyFlags.SHCNF_PATH"/> must be specified in <i>uFlags</i>. 
233 1caef52e Panagiotis Kanavos
        /// <i>dwItem1</i> contains the folder that has changed. 
234 1caef52e Panagiotis Kanavos
        /// <i>dwItem2</i> is not used and should be <see langword="null"/>. 
235 1caef52e Panagiotis Kanavos
        /// If a folder has been created, deleted, or renamed, use SHCNE_MKDIR, SHCNE_RMDIR, or 
236 1caef52e Panagiotis Kanavos
        /// SHCNE_RENAMEFOLDER, respectively, instead. 
237 1caef52e Panagiotis Kanavos
        /// </summary>
238 1caef52e Panagiotis Kanavos
        SHCNE_UPDATEDIR = 0x00001000,
239 1caef52e Panagiotis Kanavos
240 1caef52e Panagiotis Kanavos
        SHCNE_UPDATEITEM = 0x00002000,
241 1caef52e Panagiotis Kanavos
242 1caef52e Panagiotis Kanavos
        /// <summary>
243 1caef52e Panagiotis Kanavos
        /// An image in the system image list has changed. 
244 1caef52e Panagiotis Kanavos
        /// <see cref="HChangeNotifyFlags.SHCNF_DWORD"/> must be specified in <i>uFlags</i>. 
245 1caef52e Panagiotis Kanavos
        /// </summary>
246 1caef52e Panagiotis Kanavos
        SHCNE_UPDATEIMAGE = 0x00008000,
247 1caef52e Panagiotis Kanavos
248 1caef52e Panagiotis Kanavos
    }
249 1caef52e Panagiotis Kanavos
    #endregion // enum HChangeNotifyEventID
250 1caef52e Panagiotis Kanavos
251 1caef52e Panagiotis Kanavos
    #region public enum HChangeNotifyFlags
252 1caef52e Panagiotis Kanavos
    /// <summary>
253 1caef52e Panagiotis Kanavos
    /// Flags that indicate the meaning of the <i>dwItem1</i> and <i>dwItem2</i> parameters. 
254 1caef52e Panagiotis Kanavos
    /// The uFlags parameter must be one of the following values.
255 1caef52e Panagiotis Kanavos
    /// </summary>
256 1caef52e Panagiotis Kanavos
    [Flags]
257 1caef52e Panagiotis Kanavos
    public enum HChangeNotifyFlags
258 1caef52e Panagiotis Kanavos
    {
259 1caef52e Panagiotis Kanavos
        /// <summary>
260 1caef52e Panagiotis Kanavos
        /// The <i>dwItem1</i> and <i>dwItem2</i> parameters are DWORD values. 
261 1caef52e Panagiotis Kanavos
        /// </summary>
262 1caef52e Panagiotis Kanavos
        SHCNF_DWORD = 0x0003,
263 1caef52e Panagiotis Kanavos
        /// <summary>
264 1caef52e Panagiotis Kanavos
        /// <i>dwItem1</i> and <i>dwItem2</i> are the addresses of ITEMIDLIST structures that 
265 1caef52e Panagiotis Kanavos
        /// represent the item(s) affected by the change. 
266 1caef52e Panagiotis Kanavos
        /// Each ITEMIDLIST must be relative to the desktop folder. 
267 1caef52e Panagiotis Kanavos
        /// </summary>
268 1caef52e Panagiotis Kanavos
        SHCNF_IDLIST = 0x0000,
269 1caef52e Panagiotis Kanavos
        /// <summary>
270 1caef52e Panagiotis Kanavos
        /// <i>dwItem1</i> and <i>dwItem2</i> are the addresses of null-terminated strings of 
271 1caef52e Panagiotis Kanavos
        /// maximum length MAX_PATH that contain the full path names 
272 1caef52e Panagiotis Kanavos
        /// of the items affected by the change. 
273 1caef52e Panagiotis Kanavos
        /// </summary>
274 1caef52e Panagiotis Kanavos
        SHCNF_PATHA = 0x0001,
275 1caef52e Panagiotis Kanavos
        /// <summary>
276 1caef52e Panagiotis Kanavos
        /// <i>dwItem1</i> and <i>dwItem2</i> are the addresses of null-terminated strings of 
277 1caef52e Panagiotis Kanavos
        /// maximum length MAX_PATH that contain the full path names 
278 1caef52e Panagiotis Kanavos
        /// of the items affected by the change. 
279 1caef52e Panagiotis Kanavos
        /// </summary>
280 1caef52e Panagiotis Kanavos
        SHCNF_PATHW = 0x0005,
281 1caef52e Panagiotis Kanavos
        /// <summary>
282 1caef52e Panagiotis Kanavos
        /// <i>dwItem1</i> and <i>dwItem2</i> are the addresses of null-terminated strings that 
283 1caef52e Panagiotis Kanavos
        /// represent the friendly names of the printer(s) affected by the change. 
284 1caef52e Panagiotis Kanavos
        /// </summary>
285 1caef52e Panagiotis Kanavos
        SHCNF_PRINTERA = 0x0002,
286 1caef52e Panagiotis Kanavos
        /// <summary>
287 1caef52e Panagiotis Kanavos
        /// <i>dwItem1</i> and <i>dwItem2</i> are the addresses of null-terminated strings that 
288 1caef52e Panagiotis Kanavos
        /// represent the friendly names of the printer(s) affected by the change. 
289 1caef52e Panagiotis Kanavos
        /// </summary>
290 1caef52e Panagiotis Kanavos
        SHCNF_PRINTERW = 0x0006,
291 1caef52e Panagiotis Kanavos
        /// <summary>
292 1caef52e Panagiotis Kanavos
        /// The function should not return until the notification 
293 1caef52e Panagiotis Kanavos
        /// has been delivered to all affected components. 
294 1caef52e Panagiotis Kanavos
        /// As this flag modifies other data-type flags, it cannot by used by itself.
295 1caef52e Panagiotis Kanavos
        /// </summary>
296 1caef52e Panagiotis Kanavos
        SHCNF_FLUSH = 0x1000,
297 1caef52e Panagiotis Kanavos
        /// <summary>
298 1caef52e Panagiotis Kanavos
        /// The function should begin delivering notifications to all affected components 
299 1caef52e Panagiotis Kanavos
        /// but should return as soon as the notification process has begun. 
300 1caef52e Panagiotis Kanavos
        /// As this flag modifies other data-type flags, it cannot by used by itself.
301 1caef52e Panagiotis Kanavos
        /// </summary>
302 1caef52e Panagiotis Kanavos
        SHCNF_FLUSHNOWAIT = 0x2000
303 1caef52e Panagiotis Kanavos
    }
304 1caef52e Panagiotis Kanavos
    #endregion // enum HChangeNotifyFlags
305 1caef52e Panagiotis Kanavos
306 1caef52e Panagiotis Kanavos
307 1caef52e Panagiotis Kanavos
    #endregion
308 1caef52e Panagiotis Kanavos
309 1caef52e Panagiotis Kanavos
310 1caef52e Panagiotis Kanavos
    internal static class NativeMethods
311 1caef52e Panagiotis Kanavos
    {
312 1caef52e Panagiotis Kanavos
        [DllImport("shell32.dll")]
313 1caef52e Panagiotis Kanavos
        public static extern void SHChangeNotify(HChangeNotifyEventID wEventId,
314 1caef52e Panagiotis Kanavos
                                           HChangeNotifyFlags uFlags,
315 1caef52e Panagiotis Kanavos
                                           IntPtr dwItem1,
316 1caef52e Panagiotis Kanavos
                                           IntPtr dwItem2);
317 1caef52e Panagiotis Kanavos
318 1caef52e Panagiotis Kanavos
    }
319 1caef52e Panagiotis Kanavos
}