How do I get CopyFileEx to report back so I can cancel a file copy operation?

半世苍凉 提交于 2019-12-12 12:08:58

问题


I’m trying to use the FileUtilities.CopyFile wrapper for CopyFileEx from here . But the CopyFileCallbackAction doesn’t get called until after the file is copied (I’ve tried copying a large file). How do I get it to report back so I can cancel the copy if the user so wishes?

EDIT:

See Why is FileUtilities.CopyFile wrapper for CopyFileEx interfering with winforms?


回答1:


The edit to my question (sending to Why is FileUtilities.CopyFile wrapper for CopyFileEx interfering with winforms?) sends to the answer (by david-heffernan) – I had all on one thread.

EDIT: No. It seems that I had a this.Update(); missing. See How can I get code to run after a form is shown? (Trouble with "Shown".) .



来源:https://stackoverflow.com/questions/8392001/how-do-i-get-copyfileex-to-report-back-so-i-can-cancel-a-file-copy-operation

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!