想实现类似MoveFile的文件夹移动功能.
但是MoveFile所能移动的文件夹必须在同一硬盘分区上.
我需要在不同的硬盘分区上实现移动.
有什么函数或方法啊.
请达人指教.
但是MoveFile所能移动的文件夹必须在同一硬盘分区上.
我需要在不同的硬盘分区上实现移动.
有什么函数或方法啊.
请达人指教.
解决方案 »
- 关于MFC中滚动条的问题
- 逐过程调试,出现条件判断不正确
- GDI+叠加的问题,怎么清除原有的图像?
- 关于注册表键值的读取 RegQueryValueEx.请教
- 弱弱创建字体问题
- 在网上下载Visual Assist时很容易下载到病毒。请问哪里有安全的Visual Assist下载,谢谢!
- 如何获取子窗口在父窗口中的位置?
- 请分析一下,在childfrm.cpp中用this->GetActiveDocument()会取空的原因?
- 菜鸟c++--》数组,请大侠挑毛病(不胜感激)
- vc++ 2010下debug改release错误问题
- 如何在响应函数中关闭当前窗口?
- 请教Alpha是什么?能否用它实现蓝屏抠像?
SHFILEOPSTRUCT sfo;
sfo.hwnd = NULL;
sfo.wFunc = FO_MOVE;
sfo.pFrom = "c:\\My_Docs2\0";
sfo.pTo = "d:\\My_Docs2\0";
sfo.fFlags = FOF_SILENT | FOF_NOCONFIRMATION | FOF_NOCONFIRMMKDIR; hr = SHFileOperation(&sfo);
我查了msdn了啊,难得是我英语太次了啊.MoveFileThe MoveFile function moves an existing file or a directory, including its children.To specify how to move the file, use the MoveFileEx function.
BOOL MoveFile(
LPCTSTR lpExistingFileName,
LPCTSTR lpNewFileName
);Parameters
lpExistingFileName
[in] Pointer to a null-terminated string that names an existing file or directory.
In the ANSI version of this function, the name is limited to MAX_PATH characters. To extend this limit to 32,767 wide characters, call the Unicode version of the function and prepend "\\?\" to the path. For more information, see Naming a File.
Windows Me/98/95: This string must not exceed MAX_PATH characters.
lpNewFileName
[in] Pointer to a null-terminated string that specifies the new name of a file or directory. The new name must not already exist. A new file may be on a different file system or drive. A new directory must be on the same drive.
In the ANSI version of this function, the name is limited to MAX_PATH characters. To extend this limit to 32,767 wide characters, call the Unicode version of the function and prepend "\\?\" to the path. For more information, see Naming a File.
Windows Me/98/95: This string must not exceed MAX_PATH characters