tags:

views:

127

answers:

5

is there any windows API or shell API which will give a notification on when a file is added or deleted in a folder

+3  A: 

See Directory Management Functions, more specifically FindFirstChangeNotification.

Anton Gogolev
A: 

Yes, the Win32 API provides the FindFirstChangeNotification function for this.

Greg Hewgill
+4  A: 

FindFirstChangeNotification will notify you when something changes.

ReadDirectoryChangesW can give you the exact details of what changed.

efotinis
+1  A: 

These API's can help you. and you can find a nice tutorial here

FindFirstChangeNotification

FindCloseChangeNotification

FindNextChangeNotification

TuxGeek
+1  A: 

The FindFirstChangeNotification Function is already mentioned. In case you need something more than the win32 API, here is a very good project for watching folders:

CDirectoryChangeWatcher - ReadDirectoryChangesW all wrapped up

Nick D