描述:
我想在Copy文件的时候替换系统的方式,不知道是否有现成的例子或思路
十分感谢
解决方案1:
API Hook应该可以实现
解决方案2: SHFILEOPSTRUCT fo;
char strSrc[] = "f:\\1\0";
char strDst[] = "f:\\3\0";
memset(&fo, 0, sizeof(fo));
fo.wFunc = FO_COPY;
fo.pFrom = strSrc;
fo.pTo = strDst;
fo.fFlags = FOF_SIMPLEPROGRESS;
SHFileOperation(&fo);
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/structures/shfileopstruct.asp
看fflags
http://www.supercss.com/code/654.htm
http://www.lihuasoft.net/source/show.php?id=841
http://www.enet.com.cn/article/2006/0214/A20060214500548.shtml
在MSDN里看下SHFileOperation 这个函数吧
自己定义一下LPSHFILEOPSTRUCT这个结构体