| 22 | typedef _com_ptr_t<_com_IIID<IShellItem, &__uuidof(IShellItem)>> IShellItemPtr; |
| 23 | |
| 24 | bool CopyFileOrFolder(const String& src, const String& dst) |
| 25 | { |
| 26 | std::vector<tchar_t> srcpath(src.length() + 2, 0); |
| 27 | std::vector<tchar_t> dstpath(dst.length() + 2, 0); |
| 28 | memcpy(&srcpath[0], src.c_str(), src.length() * sizeof(tchar_t)); |
| 29 | memcpy(&dstpath[0], dst.c_str(), dst.length() * sizeof(tchar_t)); |
| 30 | SHFILEOPSTRUCT fileop = { 0, FO_COPY, &srcpath[0], &dstpath[0], FOF_NOCONFIRMATION, 0, 0, 0 }; |
| 31 | return SHFileOperation(&fileop) == 0; |
| 32 | } |
| 33 | |
| 34 | // |
| 35 | // OnDropFiles code from CDropEdit |