Directory watcher+ReadDirectoryChangeW

Hi Experts

I am writing a directory watcher.
If a fie is added, deleted or modified in a folder say("C:\Test")
then it should be notified by adding comments to a ListBox control
is it possible using ReadDirectoryChangeW() or using any other method.

Thank You
Shiju S N
LVL 14
Shiju SasidharanAssoc Project ManagerAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

mahesh1402Connect With a Mentor Commented:
Check out the Win32 API FindFirstChangeNotification().

Following article at codeproject describes how to create a file system spy application which will help you :

Along with FindFirstChangeNotification() and ReadDirectoryChangeW() there are undocumented functions SHChangeNotifyRegister and SHChangeNotifyDeregister that you can use in your application to know what is going on in your folder(s).
Refer :

To use FindFirstChangeNotification() you refer MSDN sample 'Obtaining Directory Change Notifications'

Shiju SasidharanAssoc Project ManagerAuthor Commented:
sorry for  the delay
Thank u all for the help

Shiju S N
All Courses

From novice to tech pro — start learning today.