楼上说的就是这个函数,msdn上面有个sample. HANDLE hNotify = ::FindFirstChangeNotification(pInfo->strMonitorPath,FALSE, FILE_NOTIFY_CHANGE_FILE_NAME|FILE_NOTIFY_CHANGE_SIZE);FILE_NOTIFY_CHANGE_FILE_NAME Any file name change in the watched directory or subtree causes a change notification wait operation to return. Changes include renaming, creating, or deleting a file name.
帮up下吧
文件改变通知是改变之后“通知”的,只能知道改变,却无法阻止改变。
完全可以啊,干嘛这么麻烦啊。
至于到回收站,毕竟还没DeleteFile。
HANDLE hNotify = ::FindFirstChangeNotification(pInfo->strMonitorPath,FALSE,
FILE_NOTIFY_CHANGE_FILE_NAME|FILE_NOTIFY_CHANGE_SIZE);FILE_NOTIFY_CHANGE_FILE_NAME Any file name change in the watched directory or subtree causes a change notification wait operation to return. Changes include renaming, creating, or deleting a file name.