shfileoperation

python win32com shell.SHFileOperation - any way to get the files that were actually deleted?

荒凉一梦 提交于 2020-01-17 04:27:07
问题 In the code I maintain I run across: from win32com.shell import shell, shellcon # ... result,nAborted,mapping = shell.SHFileOperation( (parent,operation,source,target,flags,None,None)) In Python27\Lib\site-packages\win32comext\shell\ (note win32comext) I just have a shell.pyd binary. What is the return value of shell.SHFileOperation for a deletion ( operation=FO_DELETE in the call above) ? Where is the code for the shell.pyd ? Can I get the list of files actually deleted from this return

get file name from IShellItem in IfileOperation.GetDisplayName

為{幸葍}努か 提交于 2019-12-25 13:09:09
问题 I hooked the CopyItems method of IFileOperation to monitor/intercept file copy in windows. My problem is how can i retrieve the full file name from IShellItem (last param of CopyItems) function New_CopyItems(p: Pointer; punkItems: IUnknown;psiDestinationFolder: IShellItem): HResult; stdcall; The psiDestinationFolder have a method called GetDisplayName that return only the folder name of current file was begin copied!! But i want to get full file name and don't know what i should to do !?

Double null-terminated string

只谈情不闲聊 提交于 2019-12-19 07:23:32
问题 I need to format a string to be double null-terminated string in order to use SHFileOperation. Interesting part is i found one of the following working, but not both: // Example 1 CString szDir(_T("D:\\Test")); szDir = szDir + _T('\0') + _T('\0'); // Example 2 CString szDir(_T("D:\\Test")); szDir = szDir + _T("\0\0"); //Delete folder SHFILEOPSTRUCT fileop; fileop.hwnd = NULL; // no status display fileop.wFunc = FO_DELETE; // delete operation fileop.pFrom = szDir; // source file name as double

SHFileOperation copying folders using strings

*爱你&永不变心* 提交于 2019-12-07 15:55:27
问题 I am trying to copy a folder by SHFileOperationA function. Here is my code. int main() { SHFILEOPSTRUCTA sf; int result; string source = "D:\\check\\folder4"; string dest = "D:\\Documents\\test\\folder4"; sf.pFrom = source.c_str( ); sf.pTo = dest.c_str( ); sf.wFunc = FO_COPY; sf.fFlags = FOF_NOCONFIRMATION | FOF_NOCONFIRMMKDIR | FOF_SILENT; result = SHFileOperationA(&sf); return 0; } I am not able to understand that how to make the string appended by \0 twice. I tried something like this.

SHFileOperation copying folders using strings

痞子三分冷 提交于 2019-12-05 18:34:08
I am trying to copy a folder by SHFileOperationA function. Here is my code. int main() { SHFILEOPSTRUCTA sf; int result; string source = "D:\\check\\folder4"; string dest = "D:\\Documents\\test\\folder4"; sf.pFrom = source.c_str( ); sf.pTo = dest.c_str( ); sf.wFunc = FO_COPY; sf.fFlags = FOF_NOCONFIRMATION | FOF_NOCONFIRMMKDIR | FOF_SILENT; result = SHFileOperationA(&sf); return 0; } I am not able to understand that how to make the string appended by \0 twice. I tried something like this. string source = "D:\\check\\folder4\\0\\0"; string dest = "D:\\Documents\\test\\folder4\\0\\0"; But, it is

Double null-terminated string

a 夏天 提交于 2019-12-01 04:44:44
I need to format a string to be double null-terminated string in order to use SHFileOperation. Interesting part is i found one of the following working, but not both: // Example 1 CString szDir(_T("D:\\Test")); szDir = szDir + _T('\0') + _T('\0'); // Example 2 CString szDir(_T("D:\\Test")); szDir = szDir + _T("\0\0"); //Delete folder SHFILEOPSTRUCT fileop; fileop.hwnd = NULL; // no status display fileop.wFunc = FO_DELETE; // delete operation fileop.pFrom = szDir; // source file name as double null terminated string fileop.pTo = NULL; // no destination needed fileop.fFlags = FOF_NOCONFIRMATION