Advertisement
elektrohacker

FileOperationFlags enumeration

Mar 30th, 2022
1,772
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 9.21 KB | None | 0 0
  1. ' ***********************************************************************
  2. ' Author   : ElektroStudios
  3. ' Modified : 30-March-2022
  4. ' ***********************************************************************
  5.  
  6. #Region " Option Statements "
  7.  
  8. Option Strict On
  9. Option Explicit On
  10. Option Infer Off
  11.  
  12. #End Region
  13.  
  14. #Region " Imports "
  15.  
  16. Imports DevCase.Interop.Unmanaged.Win32.Interfaces
  17.  
  18. #End Region
  19.  
  20. #Region " FileOperationFlags "
  21.  
  22. ' ReSharper disable once CheckNamespace
  23.  
  24. Namespace DevCase.Interop.Unmanaged.Win32.Enums
  25.  
  26.     ''' ----------------------------------------------------------------------------------------------------
  27.     ''' <summary>
  28.     ''' Specifies the flags that control the file operation when calling <see cref="IFileOperation.SetOperationFlags"/> function.
  29.     ''' </summary>
  30.     ''' ----------------------------------------------------------------------------------------------------
  31.     ''' <remarks>
  32.     ''' <see href="https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-ifileoperation-setoperationflags"/>
  33.     ''' </remarks>
  34.     ''' ----------------------------------------------------------------------------------------------------
  35.     <Flags>
  36.     Public Enum FileOperationFlags As UInteger
  37.  
  38.         ''' <summary>
  39.         ''' Specifies multiple destination files (one for each source file)
  40.         ''' rather than one directory where all source files are to be deposited.
  41.         ''' </summary>
  42.         ''' <remarks>
  43.         ''' <seealso href="https://docs.microsoft.com/en-us/windows/win32/api/shellapi/ns-shellapi-shfileopstructa"/>
  44.         ''' </remarks>
  45.         MultipleDestinationFiles = &H1UI
  46.  
  47.         ''' <summary>
  48.         ''' Not used.
  49.         ''' </summary>
  50.         ''' <remarks>
  51.         ''' <seealso href="https://docs.microsoft.com/en-us/windows/win32/api/shellapi/ns-shellapi-shfileopstructa"/>
  52.         ''' </remarks>
  53.         ConfirmMouse = &H2UI
  54.  
  55.         ''' <summary>
  56.         ''' Do not display a progress dialog box.
  57.         ''' </summary>
  58.         Silent = &H4UI
  59.  
  60.         ''' <summary>
  61.         ''' Give the item being operated on a new name in a move, copy,
  62.         ''' or rename operation if an item with the target name already exists.
  63.         ''' </summary>
  64.         RenameCollision = &H8UI
  65.  
  66.         ''' <summary>
  67.         ''' Respond with Yes to All for any dialog box that is displayed.
  68.         ''' </summary>
  69.         NoConfirmation = &H10UI
  70.  
  71.         ''' <summary>
  72.         ''' If <see cref="FileOperationFlags.RenameCollision"/> is specified and any files were renamed,
  73.         ''' assign a name mapping object that contains their old and new names to the SHFILEOPSTRUCT.hNameMappings member.
  74.         ''' <para></para>
  75.         ''' This object must be freed using SHFreeNameMappings function when it is no longer needed.
  76.         ''' </summary>
  77.         ''' <remarks>
  78.         ''' <seealso href="https://docs.microsoft.com/en-us/windows/win32/api/shellapi/ns-shellapi-shfileopstructa"/>
  79.         ''' </remarks>
  80.         WantMappingHandle = &H20UI
  81.  
  82.         ''' <summary>
  83.         ''' Preserve undo information, if possible.
  84.         ''' </summary>
  85.         AllowUndo = &H40UI
  86.  
  87.         ''' <summary>
  88.         ''' Perform the operation only on files (not on folders) if a wildcard file name (.) is specified.
  89.         ''' </summary>
  90.         FilesOnly = &H80UI
  91.  
  92.         ''' <summary>
  93.         ''' Display a progress dialog box but do not show individual file names as they are operated on.
  94.         ''' </summary>
  95.         ''' <remarks>
  96.         ''' <seealso href="https://docs.microsoft.com/en-us/windows/win32/api/shellapi/ns-shellapi-shfileopstructa"/>
  97.         ''' </remarks>
  98.         SimpleProgress = &H100UI
  99.  
  100.         ''' <summary>
  101.         ''' Do not confirm the creation of a new folder if the operation requires one to be created.
  102.         ''' </summary>
  103.         NoConfirmMakeDir = &H200UI
  104.  
  105.         ''' <summary>
  106.         ''' Do not display a message to the user if an error occurs.
  107.         ''' <para></para>
  108.         ''' If this flag is set without <see cref="FileOperationFlags.EarlyFailure"/>,
  109.         ''' any error is treated as if the user had chosen Ignore or Continue in a dialog box.
  110.         ''' <para></para>
  111.         ''' It halts the current action, sets a flag to indicate that an action was aborted,
  112.         ''' and proceeds with the rest of the operation.
  113.         ''' </summary>
  114.         NoErrorUI = &H400UI
  115.  
  116.         ''' <summary>
  117.         ''' Do not copy the security attributes of the item.
  118.         ''' </summary>
  119.         NoCopySecurityAttributes = &H800UI
  120.  
  121.         ''' <summary>
  122.         ''' Only operate in the local folder. Do not operate recursively into subdirectories.
  123.         ''' </summary>
  124.         NoRecursion = &H1000UI
  125.  
  126.         ''' <summary>
  127.         ''' Do not move connected items as a group. Only move the specified files.
  128.         ''' </summary>
  129.         NoConnectedElements = &H2000UI
  130.  
  131.         ''' <summary>
  132.         ''' Send a warning if a file or folder is being destroyed during a delete operation rather than recycled.
  133.         ''' <para></para>
  134.         ''' This flag partially overrides <see cref="FileOperationFlags.NoConfirmation"/>.
  135.         ''' </summary>
  136.         WantNukeWarning = &H4000UI
  137.  
  138.         ''' <summary>
  139.         ''' Not used.
  140.         ''' </summary>
  141.         ''' <remarks>
  142.         ''' <seealso href="https://docs.microsoft.com/en-us/windows/win32/api/shellapi/ns-shellapi-shfileopstructa"/>
  143.         ''' </remarks>
  144.         NoRecurseReparse = &H8000UI
  145.  
  146.         ''' <summary>
  147.         ''' Walk into Shell namespace junctions.
  148.         ''' <para></para>
  149.         ''' By default, junctions are not entered.
  150.         ''' </summary>
  151.         NoSkipJunctions = &H10000UI
  152.  
  153.         ''' <summary>
  154.         ''' If possible, create a hard link rather than a new instance of the file in the destination.
  155.         ''' </summary>
  156.         PreferHardLink = &H20000UI
  157.  
  158.         ''' <summary>
  159.         ''' If an operation requires elevated rights
  160.         ''' and the <see cref="FileOperationFlags.NoErrorUI"/> flag is set to disable error UI,
  161.         ''' display a UAC UI prompt nonetheless.
  162.         ''' </summary>
  163.         ShowElevationPrompt = &H40000UI
  164.  
  165.         ''' <summary>
  166.         ''' If <see cref="FileOperationFlags.EarlyFailure"/> is set together with <see cref="FileOperationFlags.NoErrorUI"/>,
  167.         ''' the entire set of operations is stopped upon encountering any error in any operation.
  168.         ''' <para></para>
  169.         ''' This flag is valid only when <see cref="FileOperationFlags.NoErrorUI"/> is set.
  170.         ''' </summary>
  171.         EarlyFailure = &H100000UI
  172.  
  173.         ''' <summary>
  174.         ''' Rename collisions in such a way as to preserve file name extensions.
  175.         ''' <para></para>
  176.         ''' This flag is valid only when <see cref="FileOperationFlags.RenameCollision"/> is also set.
  177.         ''' </summary>
  178.         PreserveFileExtensions = &H200000UI
  179.  
  180.         ''' <summary>
  181.         ''' Keep the newer file or folder, based on the Date Modified property, if a collision occurs.
  182.         ''' <para></para>
  183.         ''' This is done automatically with no prompt UI presented to the user.
  184.         ''' </summary>
  185.         KeepNewerFile = &H400000UI
  186.  
  187.         ''' <summary>
  188.         ''' Do not use copy hooks.
  189.         ''' </summary>
  190.         NoCopyHooks = &H800000UI
  191.  
  192.         ''' <summary>
  193.         ''' Do not allow the progress dialog to be minimized.
  194.         ''' </summary>
  195.         NoMinimizeBox = &H1000000UI
  196.  
  197.         ''' <summary>
  198.         ''' Copy the security attributes of the source item to the destination item
  199.         ''' when performing a cross-volume move operation.
  200.         ''' <para></para>
  201.         ''' Without this flag, the destination item receives the security attributes of its new folder.
  202.         ''' </summary>
  203.         MoveAclsAcrossVolumes = &H2000000UI
  204.  
  205.         ''' <summary>
  206.         ''' Do not display the path of the source item in the progress dialog.
  207.         ''' </summary>
  208.         DontDisplaySourcePath = &H4000000UI
  209.  
  210.         ''' <summary>
  211.         ''' Do not display the path of the destination item in the progress dialog.
  212.         ''' </summary>
  213.         DontDisplayDestinationPath = &H8000000UI
  214.  
  215.         ''' <summary>
  216.         ''' The file operation was user-invoked and should be placed on the undo stack.
  217.         ''' <para></para>
  218.         ''' This flag is preferred to <see cref="FileOperationFlags.AllowUndo"/>.
  219.         ''' </summary>
  220.         AddUndoRecord = &H20000000UI
  221.  
  222.         ''' <summary>
  223.         ''' When a file is deleted, send it to the Recycle Bin rather than permanently deleting it.
  224.         ''' </summary>
  225.         RecycleOnDelete = &H80000UI
  226.  
  227.         ''' <summary>
  228.         ''' The user expects a requirement for rights elevation,
  229.         ''' so do not display a dialog box asking for a confirmation of the elevation.
  230.         ''' </summary>
  231.         RequireElevation = &H10000000UI
  232.  
  233.         ''' <summary>
  234.         ''' Display a Downloading instead of Copying message in the progress dialog.
  235.         ''' </summary>
  236.         CopyAsDownload = &H40000000UI
  237.  
  238.         ''' <summary>
  239.         ''' Do not display the location line in the progress dialog.
  240.         ''' </summary>
  241.         DontDisplayLocations = &H80000000UI
  242.  
  243.     End Enum
  244.  
  245. End Namespace
  246.  
  247. #End Region
  248.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement