Hi,
the Windows API SHChangeNotifyRegister can detect file creation in disk, but how to know if 'file creation' is caused by file copy or not? thank you!
[EDITED], I mean SHChangeNotifyRegister, but not SHChangeNotify, sorry!
Hi,
the Windows API SHChangeNotifyRegister can detect file creation in disk, but how to know if 'file creation' is caused by file copy or not? thank you!
[EDITED], I mean SHChangeNotifyRegister, but not SHChangeNotify, sorry!
SHChangeNotify is not an API which tells you that something has changed, but an API which you tell the shell that you changed something and it should update its views accordingly.
Maybe what you want is ReadDirectoryChangesW
If you know the file name which is changed you can examine it's creation and last write times with respect of GetFileTime. If you copy a file from one directory to another you don't modify the file contain, so the last write times will stay unchanged.