Attention, non testé (Je n'ai pas windows):
#include <windows.h>
#include <stdio.h>
int copy_all(const char* from, const char* to)
{
SHFILEOPSTRUCT sf;
memset(&sf, 0, sizeof(sf));
sf.hwnd = 0;
sf.wFunc = FO_COPY;
sf.pFrom = from;
sf.pTo = to;
sf.fFlags = FOF_NOCONFIRMATION | FOF_NOCONFIRMMKDIR | FOF_NOERRORUI;
return SHFileOperation(&sf);
}
int main(void)
{
int res = 0;
res = copy_all("C:\\Nouveau Dossier", "C:\\Documents and Settings\\roxod\\Bureau");
if (res == 0)
{
printf("Success\n");
}
else
{
printf("Failed\n");
}
return 0;
}