#include
#include
#include
#pragma comment(lib, "shell32.lib")
int main()
{
SHFILEOPSTRUCT fop;
ZeroMemory(&fop, sizeof fop);
fop.wFunc = FO_COPY;
fop.pFrom = _T("c:\\a\0");
fop.pTo = _T("c:\\b\0");
SHFileOperation(&fop);
return 0;
}
用SHFileOperation解决。
注意pFrom和pTo都是以【!两个!】\0结尾的字符串