Beispiel #1
0
        public static bool DoOperation(IntPtr Handle, string[] source, string dest, APIsEnums.FileOperations operation)
        {
            APIsStructs.SHFILEOPSTRUCT fileop = new APIsStructs.SHFILEOPSTRUCT();
            fileop.hwnd = Handle;
            fileop.lpszProgressTitle = Enum.GetName(typeof(APIsEnums.FileOperations), operation);
            fileop.wFunc             = (uint)operation;
            fileop.pFrom             = Marshal.StringToHGlobalUni(StringArrayToMultiString(source));
            fileop.pTo = Marshal.StringToHGlobalUni(dest);
            fileop.fAnyOperationsAborted = 0;
            fileop.hNameMappings         = IntPtr.Zero;

            return(SHFileOperation(ref fileop) == 0);
        }
Beispiel #2
0
 public static extern Int32 SHFileOperation(
     ref APIsStructs.SHFILEOPSTRUCT FileOp);