-1

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.

Kosmo零
  • 4,001
  • 9
  • 45
  • 88

1 Answers1

2

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

Jochen Kalmbach
  • 3,549
  • 17
  • 18