Question

I thinking about some global hook, but googling for "file create hook" gave me nothing.

I doing folder explorer in my prog... and I would like to add / remove files from visual representation in my prog as soon as they got added / deleted / appeared (for network folders), instead of running loop to scan the folder all the time.

Is that possible? I hope for some WinAPI solution.

Was it helpful?

Solution

You can use ReadDirectoryChangesW which notifies you of changes in a specific directory.

Also you can use SHChangeNotifyRegister, which is a shell feature and also works for "shell" forlders..

I suggest to read the following article: Understanding ReadDirectoryChangesW - Part 1

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top