Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Download Visual Studio Add-In

FindFirstChangeNotification (kernel32)
 
.
Summary

C# Signature:

[DllImport("kernel32.dll")]
static extern IntPtr FindFirstChangeNotification(string lpPathName,
   bool bWatchSubtree, uint dwNotifyFilter);

User-Defined Types:

None.

Notes:

Constants to pass for dwNotifyFilter. Found in winnt.h by searching for the ones used in the msdn example.

FILE_NOTIFY_CHANGE_FILE_NAME 0x00000001

FILE_NOTIFY_CHANGE_DIR_NAME 0x00000002

FILE_NOTIFY_CHANGE_ATTRIBUTES 0x00000004

FILE_NOTIFY_CHANGE_SIZE 0x00000008

FILE_NOTIFY_CHANGE_LAST_WRITE 0x00000010

FILE_NOTIFY_CHANGE_LAST_ACCESS 0x00000020

FILE_NOTIFY_CHANGE_CREATION 0x00000040

FILE_NOTIFY_CHANGE_SECURITY 0x00000100

Tips & Tricks:

Please add some!

Sample Code:

Please add some!

Alternative Managed API:

System.IO.FileSystemWatcher

Documentation

C++ Language example using this api call.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/obtaining_directory_change_notifications.asp (dead link)

https://msdn.microsoft.com/en-us/library/windows/desktop/aa365261(v=vs.85).aspx

Please edit this page!

Do you have...

  • helpful tips or sample code to share for using this API in managed code?
  • corrections to the existing content?
  • variations of the signature you want to share?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).

 
Access PInvoke.net directly from VS:
Terms of Use
Edit This Page
Find References
Show Printable Version
Revisions