Frage

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.

War es hilfreich?

Lösung

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

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top