I am currently developing backup software, which I was using File.Copy() to copy files.
However File.Copy() doesn’t have the option to cancel, so after a bit of googling I found CopyFileEx does. I had a look through the P/Invoke docs but I can’t work out how I can actually send the flag to cancel it without calling the whole function again.
Can I just set a bool value and reference that, and will CopyFileEx detect that it has changed if I change it from somewhere else?
Any help or examples appreciated.
Yes, see http://msdn.microsoft.com/en-us/library/windows/desktop/aa363852(v=vs.85).aspx