近期在开发中发现SHFileOperation函数在Win7中的使用对路径的格式有更加严格的限制,而在Win8中则直接报错,返回值为8,错误原因不详。
在MSDN中发现如下说明:
Note As of Windows Vista, the use of the
IFileOperation interface is recommended over this function.
由于IFileOperation接口的使用过于繁琐,暂时以CopyFile函数代替,在Vista以后的版本中尽量不再使用SHFileOperation函数。