#Region " System Notifier "
' [ System Notifier ]
'
' Examples :
'
' SystemNotifier.Notify(SystemNotifier.EventID.FileAssociation_Changed, SystemNotifier.NotifyFlags.DWORD, IntPtr.Zero, IntPtr.Zero)
Public Class SystemNotifier
<System.Runtime.InteropServices.DllImport("shell32.dll")> _
Shared Sub SHChangeNotify( _
ByVal wEventID As EventID, _
ByVal uFlags As NotifyFlags, _
ByVal dwItem1 As IntPtr, _
ByVal dwItem2 As IntPtr)
End Sub
Shared Sub Notify(ByVal wEventID As EventID, ByVal uFlags As NotifyFlags, ByVal dwItem1 As IntPtr, ByVal dwItem2 As IntPtr)
SHChangeNotify(wEventID, uFlags, dwItem1, dwItem2)
End Sub
<Flags()> _
Public Enum NotifyFlags
' <summary>
' The <i>dwItem1</i> and <i>dwItem2</i> parameters are DWORD values.
' </summary>
DWORD = &H3
' <summary>
' <i>dwItem1</i> and <i>dwItem2</i> are the addresses of ItemIDList structures,
' that represent the item(s) affected by the change.
' Each ItemIDList must be relative to the desktop folder.
' </summary>
ItemIDList = &H0
' <summary>
' <i>dwItem1</i> and <i>dwItem2</i> are the addresses of null-terminated strings,
' of maximum length MAX_PATH that contain the full path names of the items affected by the change.
' </summary>
PathA = &H1
' <summary>
' <i>dwItem1</i> and <i>dwItem2</i> are the addresses of null-terminated strings,
' of maximum length MAX_PATH that contain the full path names of the items affected by the change.
' </summary>
PathW = &H5
' <summary>
' <i>dwItem1</i> and <i>dwItem2</i> are the addresses of null-terminated strings,
' that represent the friendly names of the printer(s) affected by the change.
' </summary>
PrinterA = &H2
' <summary>
' <i>dwItem1</i> and <i>dwItem2</i> are the addresses of null-terminated strings,
' that represent the friendly names of the printer(s) affected by the change.
' </summary>
PrinterW = &H6
' <summary>
' The function should not return until the notification has been delivered to all affected components.
' As this flag modifies other data-type flags it cannot by used by itself.
' </summary>
Flush = &H1000
' <summary>
' The function should begin delivering notifications to all affected components,
' but should return as soon as the notification process has begun.
' As this flag modifies other data-type flags it cannot by used by itself.
' </summary>
FlushNoWait = &H2000
End Enum
<Flags()> _
Public Enum EventID
' <summary>
' All events have occurred.
' </summary>
All_Events = &H7FFFFFFF
' <summary>
' A folder has been created.
' <see cref="NotifyFlags.ItemIDList"/> or <see cref="NotifyFlags.PathA"/> must be specified in <i>uFlags</i>.
' <i>dwItem1</i> contains the folder that was created.
' <i>dwItem2</i> is not used and should be <see langword="null"/>.
' </summary>
Directory_Created = &H8
' <summary>
' A folder has been removed.
' <see cref="NotifyFlags.ItemIDList"/> or <see cref="NotifyFlags.PathA"/> must be specified in <i>uFlags</i>.
' <i>dwItem1</i> contains the folder that was removed.
' <i>dwItem2</i> is not used and should be <see langword="null"/>.
' </summary>
Directory_Deleted = &H10
' <summary>
' The name of a folder has changed.
' <see cref="NotifyFlags.ItemIDList"/> or <see cref="NotifyFlags.PathA"/> must be specified in <i>uFlags</i>.
' <i>dwItem1</i> contains the previous pointer to an item identifier list (PIDL) or name of the folder.
' <i>dwItem2</i> contains the new PIDL or name of the folder.
' </summary>
Directory_Renamed = &H20000
' <summary>
' A nonfolder item has been created.
' <see cref="NotifyFlags.ItemIDList"/> or <see cref="NotifyFlags.PathA"/> must be specified in <i>uFlags</i>.
' <i>dwItem1</i> contains the item that was created.
' <i>dwItem2</i> is not used and should be <see langword="null"/>.
' </summary>
Item_Created = &H2
' <summary>
' A nonfolder item has been deleted.
' <see cref="NotifyFlags.ItemIDList"/> or <see cref="NotifyFlags.PathA"/> must be specified in <i>uFlags</i>.
' <i>dwItem1</i> contains the item that was deleted.
' <i>dwItem2</i> is not used and should be <see langword="null"/>.
' </summary>
Item_Deleted = &H4
' <summary>
' The name of a nonfolder item has changed.
' <see cref="NotifyFlags.ItemIDList"/> or <see cref="NotifyFlags.PathA"/> must be specified in <i>uFlags</i>.
' <i>dwItem1</i> contains the previous PIDL or name of the item.
' <i>dwItem2</i> contains the new PIDL or name of the item.
' </summary>
Item_Renamed = &H1
' <summary>
' A drive has been added.
' <see cref="NotifyFlags.ItemIDList"/> or <see cref="NotifyFlags.PathA"/> must be specified in <i>uFlags</i>.
' <i>dwItem1</i> contains the root of the drive that was added.
' <i>dwItem2</i> is not used and should be <see langword="null"/>.
' </summary>
Drive_Added = &H100
' <summary>
' A drive has been added and the Shell should create a new window for the drive.
' <see cref="NotifyFlags.ItemIDList"/> or <see cref="NotifyFlags.PathA"/> must be specified in <i>uFlags</i>.
' <i>dwItem1</i> contains the root of the drive that was added.
' <i>dwItem2</i> is not used and should be <see langword="null"/>.
' </summary>
Drive_Added_Shell = &H10000
' <summary>
' A drive has been removed. <see cref="NotifyFlags.ItemIDList"/> or <see cref="NotifyFlags.PathA"/> must be specified in <i>uFlags</i>.
' <i>dwItem1</i> contains the root of the drive that was removed.
' <i>dwItem2</i> is not used and should be <see langword="null"/>.
' </summary>
Drive_Removed = &H80
' <summary>
' Storage media has been inserted into a drive.
' <see cref="NotifyFlags.ItemIDList"/> or <see cref="NotifyFlags.PathA"/> must be specified in <i>uFlags</i>.
' <i>dwItem1</i> contains the root of the drive that contains the new media.
' <i>dwItem2</i> is not used and should be <see langword="null"/>.
' </summary>
Media_Inserted = &H20
' <summary>
' Storage media has been removed from a drive.
' <see cref="NotifyFlags.ItemIDList"/> or <see cref="NotifyFlags.PathA"/> must be specified in <i>uFlags</i>.
' <i>dwItem1</i> contains the root of the drive from which the media was removed.
' <i>dwItem2</i> is not used and should be <see langword="null"/>.
' </summary>
Media_Removed = &H40
' <summary>
' A folder on the local computer is being shared via the network.
' <see cref="NotifyFlags.ItemIDList"/> or <see cref="NotifyFlags.PathA"/> must be specified in <i>uFlags</i>.
' <i>dwItem1</i> contains the folder that is being shared.
' <i>dwItem2</i> is not used and should be <see langword="null"/>.
' </summary>
Net_Shared = &H200
' <summary>
' A folder on the local computer is no longer being shared via the network.
' <see cref="NotifyFlags.ItemIDList"/> or <see cref="NotifyFlags.PathA"/> must be specified in <i>uFlags</i>.
' <i>dwItem1</i> contains the folder that is no longer being shared.
' <i>dwItem2</i> is not used and should be <see langword="null"/>.
' </summary>
Net_Unshared = &H400
' <summary>
' The computer has disconnected from a server.
' <see cref="NotifyFlags.ItemIDList"/> or <see cref="NotifyFlags.PathA"/> must be specified in <i>uFlags</i>.
' <i>dwItem1</i> contains the server from which the computer was disconnected.
' <i>dwItem2</i> is not used and should be <see langword="null"/>.
' </summary>
Server_Disconnected = &H4000
' <summary>
' The attributes of an item or folder have changed.
' <see cref="NotifyFlags.ItemIDList"/> or <see cref="NotifyFlags.PathA"/> must be specified in <i>uFlags</i>.
' <i>dwItem1</i> contains the item or folder that has changed.
' <i>dwItem2</i> is not used and should be <see langword="null"/>.
' </summary>
Attributes_Changed = &H800
' <summary>
' A file type association has changed. <see cref="NotifyFlags.ItemIDList"/>
' must be specified in the <i>uFlags</i> parameter.
' <i>dwItem1</i> and <i>dwItem2</i> are not used and must be <see langword="null"/>.
' </summary>
FileAssociation_Changed = &H8000000
' <summary>
' The amount of free space on a drive has changed.
' <see cref="NotifyFlags.ItemIDList"/> or <see cref="NotifyFlags.PathA"/> must be specified in <i>uFlags</i>.
' <i>dwItem1</i> contains the root of the drive on which the free space changed.
' <i>dwItem2</i> is not used and should be <see langword="null"/>.
' </summary>
Freespace_Changed = &H40000
' <summary>
' The contents of an existing folder have changed but the folder still exists and has not been renamed.
' <see cref="NotifyFlags.ItemIDList"/> or <see cref="NotifyFlags.PathA"/> must be specified in <i>uFlags</i>.
' <i>dwItem1</i> contains the folder that has changed.
' <i>dwItem2</i> is not used and should be <see langword="null"/>.
' If a folder has been created, deleted or renamed use Directory_Created, Directory_Removed or Directory_Renamed respectively instead.
' </summary>
Update_Directory = &H1000
' <summary>
' An image in the system image list has changed.
' <see cref="NotifyFlags.DWORD"/> must be specified in <i>uFlags</i>.
' </summary>
Update_Image = &H8000
End Enum
End Class
#End Region