Exemple #1
0
 public unsafe static extern bool ReadDirectoryChangesW(
     SafeFileHandle hDirectory,
     void *lpBuffer,
     uint nBufferLength,
     bool bWatchSubtree,
     FileNotifyChange dwNotifyFilter,
     out uint lpBytesReturned,
     ref OVERLAPPED lpOverlapped,
     FileIOCompletionRoutine lpCompletionRoutine);
 /// <summary>
 /// Creates a change notification handle and sets up initial change notification filter conditions. A wait on a notification handle 
 /// succeeds when a change matching the filter conditions occurs in the specified directory or subtree. The function does not report
 /// changes to the specified directory itself.
 /// This function does not indicate the change that satisfied the wait condition. To retrieve information about the specific change 
 /// as part of the notification, use the ReadDirectoryChangesW function
 /// </summary>
 /// <param name="lpPathName">The path of the directory to be watched</param>
 /// <param name="bWatchSubtree">If this parameter is true, the function monitors the directory tree rooted at the specified directory;
 /// if it is false, it monitors only the specified directory</param>
 /// <param name="dwNotifyFilter">The filter conditions that satisfy a change notification wait</param>
 /// <returns>If the function succeeds, the return value is a handle to a find change notification object</returns>
 public static IntPtr FindFirstChangeNotification([In] string lpPathName, bool bWatchSubtree,
     FileNotifyChange dwNotifyFilter)
 {
     return Environment.OSVersion.Platform >= PlatformID.Win32NT ? Native.FindFirstChangeNotificationW(lpPathName, bWatchSubtree, dwNotifyFilter) : Native.FindFirstChangeNotificationA(lpPathName, bWatchSubtree, dwNotifyFilter);
 }
 public static extern IntPtr FindFirstChangeNotificationW(
     [In] [MarshalAs(UnmanagedType.LPWStr)] string lpPathName,
     [MarshalAs(UnmanagedType.Bool)] bool bWatchSubtree, FileNotifyChange dwNotifyFilter);
Exemple #4
0
 /// <summary>
 /// Creates a change notification handle and sets up initial change notification filter conditions. A wait on a notification handle
 /// succeeds when a change matching the filter conditions occurs in the specified directory or subtree. The function does not report
 /// changes to the specified directory itself.
 /// This function does not indicate the change that satisfied the wait condition. To retrieve information about the specific change
 /// as part of the notification, use the ReadDirectoryChangesW function
 /// </summary>
 /// <param name="lpPathName">The path of the directory to be watched</param>
 /// <param name="bWatchSubtree">If this parameter is true, the function monitors the directory tree rooted at the specified directory;
 /// if it is false, it monitors only the specified directory</param>
 /// <param name="dwNotifyFilter">The filter conditions that satisfy a change notification wait</param>
 /// <returns>If the function succeeds, the return value is a handle to a find change notification object</returns>
 public static IntPtr FindFirstChangeNotification([In] string lpPathName, bool bWatchSubtree,
                                                  FileNotifyChange dwNotifyFilter)
 {
     return(Environment.OSVersion.Platform >= PlatformID.Win32NT ? Native.FindFirstChangeNotificationW(lpPathName, bWatchSubtree, dwNotifyFilter) : Native.FindFirstChangeNotificationA(lpPathName, bWatchSubtree, dwNotifyFilter));
 }
Exemple #5
0
 public static extern IntPtr FindFirstChangeNotificationW(
     [In][MarshalAs(UnmanagedType.LPWStr)] string lpPathName,
     [MarshalAs(UnmanagedType.Bool)] bool bWatchSubtree, FileNotifyChange dwNotifyFilter);