문제

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.

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top