Advertisement
elektrohacker

IFileOperation interface

Mar 30th, 2022
1,520
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 30.40 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 System.IO
  17. Imports System.Runtime.InteropServices
  18.  
  19. Imports DevCase.Interop.Unmanaged.Win32.Enums
  20.  
  21. #End Region
  22.  
  23. #Region " IFileOperation "
  24.  
  25. ' ReSharper disable once CheckNamespace
  26.  
  27. Namespace DevCase.Interop.Unmanaged.Win32.Interfaces
  28.  
  29.     ''' ----------------------------------------------------------------------------------------------------
  30.     ''' <summary>
  31.     ''' Exposes methods to copy, move, rename, create, and delete Shell items
  32.     ''' as well as methods to provide progress and error dialogs.
  33.     ''' <para></para>
  34.     ''' This interface replaces the SHFileOperation function.
  35.     ''' </summary>
  36.     ''' ----------------------------------------------------------------------------------------------------
  37.     ''' <remarks>
  38.     ''' <see href="https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nn-shobjidl_core-ifileoperation"/>
  39.     ''' </remarks>
  40.     ''' ----------------------------------------------------------------------------------------------------
  41.     <ComImport>
  42.     <Guid("947aab5f-0a5c-4c13-b4d6-4bf7836fc9f8")>
  43.     <InterfaceType(ComInterfaceType.InterfaceIsIUnknown)>
  44.     Public Interface IFileOperation
  45.  
  46.         ''' ----------------------------------------------------------------------------------------------------
  47.         ''' <summary>
  48.         ''' Enables a handler to provide status and error information for all operations
  49.         ''' </summary>
  50.         ''' ----------------------------------------------------------------------------------------------------
  51.         ''' <param name="pfops">
  52.         ''' Pointer to an <see cref="IFileOperationProgressSink"/> object to be used
  53.         ''' for progress status and error notifications.
  54.         ''' </param>
  55.         '''
  56.         ''' <param name="pdwCookie">
  57.         ''' When this method returns, this parameter points to a returned token
  58.         ''' that uniquely identifies this connection.
  59.         ''' <para></para>
  60.         ''' The calling application uses this token later to delete the connection
  61.         ''' by passing it to <see cref="IFileOperation.Unadvise"/>.
  62.         ''' <para></para>
  63.         ''' If the call to Advise fails, this value is meaningless.
  64.         ''' </param>
  65.         ''' ----------------------------------------------------------------------------------------------------
  66.         ''' <returns>
  67.         ''' If this method succeeds, it returns <see cref="HResult.S_OK"/>.
  68.         ''' Otherwise, it returns an <see cref="HResult"/> error code.
  69.         ''' </returns>
  70.         ''' ----------------------------------------------------------------------------------------------------
  71.         Function Advise(pfops As IFileOperationProgressSink, <[Out]> ByRef pdwCookie As UInteger) As HResult
  72.  
  73.         ''' ----------------------------------------------------------------------------------------------------
  74.         ''' <summary>
  75.         ''' Terminates an advisory connection previously established through <see cref="IFileOperation.Advise"/>
  76.         ''' </summary>
  77.         ''' ----------------------------------------------------------------------------------------------------
  78.         ''' <param name="dwCookie">
  79.         ''' The connection token that identifies the connection to delete.
  80.         ''' <para></para>
  81.         ''' This value was originally retrieved by <see cref="IFileOperation.Advise"/> when the connection was made.
  82.         ''' </param>
  83.         ''' ----------------------------------------------------------------------------------------------------
  84.         ''' <returns>
  85.         ''' If this method succeeds, it returns <see cref="HResult.S_OK"/>.
  86.         ''' Otherwise, it returns an <see cref="HResult"/> error code.
  87.         ''' </returns>
  88.         ''' ----------------------------------------------------------------------------------------------------
  89.         Function Unadvise(dwCookie As UInteger) As HResult
  90.  
  91.         ''' ----------------------------------------------------------------------------------------------------
  92.         ''' <summary>
  93.         ''' Sets parameters for the current operation.
  94.         ''' </summary>
  95.         ''' ----------------------------------------------------------------------------------------------------
  96.         ''' <param name="dwOperationFlags">
  97.         ''' Flags that control the file operation.
  98.         ''' <para></para>
  99.         ''' Note: If <see cref="IFileOperation.SetOperationFlags"/> function is not called,
  100.         ''' the default flags used by the operation are:
  101.         ''' <see cref="FileOperationFlags.AllowUndo"/> + <see cref="FileOperationFlags.NoConfirmMakeDir"/>.
  102.         ''' </param>
  103.         ''' ----------------------------------------------------------------------------------------------------
  104.         ''' <returns>
  105.         ''' If this method succeeds, it returns <see cref="HResult.S_OK"/>.
  106.         ''' Otherwise, it returns an <see cref="HResult"/> error code.
  107.         ''' </returns>
  108.         ''' ----------------------------------------------------------------------------------------------------
  109.         Function SetOperationFlags(dwOperationFlags As FileOperationFlags) As HResult
  110.  
  111.         ''' ----------------------------------------------------------------------------------------------------
  112.         ''' <summary>
  113.         ''' Not implemented.
  114.         ''' </summary>
  115.         ''' ----------------------------------------------------------------------------------------------------
  116.         ''' <param name="pszMessage">
  117.         ''' Pointer to the window title. This is a null-terminated, Unicode string.
  118.         ''' </param>
  119.         ''' ----------------------------------------------------------------------------------------------------
  120.         ''' <returns>
  121.         ''' If this method succeeds, it returns <see cref="HResult.S_OK"/>.
  122.         ''' Otherwise, it returns an <see cref="HResult"/> error code.
  123.         ''' </returns>
  124.         ''' ----------------------------------------------------------------------------------------------------
  125.         Function SetProgressMessage(<MarshalAs(UnmanagedType.LPWStr)> pszMessage As String) As HResult
  126.  
  127.         ''' ----------------------------------------------------------------------------------------------------
  128.         ''' <summary>
  129.         ''' Specifies a dialog box used to display the progress of the operation.
  130.         ''' </summary>
  131.         ''' ----------------------------------------------------------------------------------------------------
  132.         ''' <param name="popd">
  133.         ''' Pointer to an IOperationsProgressDialog object that represents the dialog box.
  134.         ''' </param>
  135.         ''' ----------------------------------------------------------------------------------------------------
  136.         ''' <returns>
  137.         ''' If this method succeeds, it returns <see cref="HResult.S_OK"/>.
  138.         ''' Otherwise, it returns an <see cref="HResult"/> error code.
  139.         ''' </returns>
  140.         ''' ----------------------------------------------------------------------------------------------------
  141.         Function SetProgressDialog(<MarshalAs(UnmanagedType.Interface)> popd As Object) As HResult
  142.  
  143.         ''' ----------------------------------------------------------------------------------------------------
  144.         ''' <summary>
  145.         ''' Declares a set of properties and values to be set on an item or items.
  146.         ''' </summary>
  147.         ''' ----------------------------------------------------------------------------------------------------
  148.         ''' <param name="pproparray">
  149.         ''' Pointer to an IPropertyChangeArray,
  150.         ''' which accesses a collection of IPropertyChange objects that specify the
  151.         ''' properties to be set and their new values.
  152.         ''' </param>
  153.         ''' ----------------------------------------------------------------------------------------------------
  154.         ''' <returns>
  155.         ''' If this method succeeds, it returns <see cref="HResult.S_OK"/>.
  156.         ''' Otherwise, it returns an <see cref="HResult"/> error code.
  157.         ''' </returns>
  158.         ''' ----------------------------------------------------------------------------------------------------
  159.         Function SetProperties(<MarshalAs(UnmanagedType.Interface)> pproparray As Object) As HResult
  160.  
  161.         ''' ----------------------------------------------------------------------------------------------------
  162.         ''' <summary>
  163.         ''' Sets the parent or owner window for progress and dialog windows.
  164.         ''' </summary>
  165.         ''' ----------------------------------------------------------------------------------------------------
  166.         ''' <param name="hwndParent">
  167.         ''' A handle to the owner window of the operation. This window will receive error messages.
  168.         ''' </param>
  169.         ''' ----------------------------------------------------------------------------------------------------
  170.         ''' <returns>
  171.         ''' If this method succeeds, it returns <see cref="HResult.S_OK"/>.
  172.         ''' Otherwise, it returns an <see cref="HResult"/> error code.
  173.         ''' </returns>
  174.         ''' ----------------------------------------------------------------------------------------------------
  175.         Function SetOwnerWindow(hwndParent As UInteger) As HResult
  176.  
  177.         ''' ----------------------------------------------------------------------------------------------------
  178.         ''' <summary>
  179.         ''' Declares a single item whose property values are to be set.
  180.         ''' </summary>
  181.         ''' ----------------------------------------------------------------------------------------------------
  182.         ''' <param name="psiItem">
  183.         ''' Pointer to the item to receive the new property values.
  184.         ''' </param>
  185.         ''' ----------------------------------------------------------------------------------------------------
  186.         ''' <returns>
  187.         ''' If this method succeeds, it returns <see cref="HResult.S_OK"/>.
  188.         ''' Otherwise, it returns an <see cref="HResult"/> error code.
  189.         ''' </returns>
  190.         ''' ----------------------------------------------------------------------------------------------------
  191.         Function ApplyPropertiesToItem(psiItem As IShellItem) As HResult
  192.  
  193.         ''' ----------------------------------------------------------------------------------------------------
  194.         ''' <summary>
  195.         ''' Declares a set of items for which to apply a common set of property values.
  196.         ''' </summary>
  197.         ''' ----------------------------------------------------------------------------------------------------
  198.         ''' <param name="punkItems">
  199.         ''' Pointer to the <see cref="IUnknown"/> of the IShellItemArray,
  200.         ''' IDataObject, or IEnumShellItems object which represents the group of items.
  201.         ''' <para></para>
  202.         ''' You can also point to an IPersistIDList object to represent a single item,
  203.         ''' effectively accomplishing the same function as <see cref="IFileOperation.ApplyPropertiesToItem"/>.
  204.         ''' </param>
  205.         ''' ----------------------------------------------------------------------------------------------------
  206.         ''' <returns>
  207.         ''' If this method succeeds, it returns <see cref="HResult.S_OK"/>.
  208.         ''' Otherwise, it returns an <see cref="HResult"/> error code.
  209.         ''' </returns>
  210.         ''' ----------------------------------------------------------------------------------------------------
  211.         Function ApplyPropertiesToItems(<MarshalAs(UnmanagedType.Interface)> punkItems As Object) As HResult
  212.  
  213.         ''' ----------------------------------------------------------------------------------------------------
  214.         ''' <summary>
  215.         ''' Declares a single item that is to be given a new display name.
  216.         ''' </summary>
  217.         ''' ----------------------------------------------------------------------------------------------------
  218.         ''' <param name="psiItem">
  219.         ''' Pointer to an <see cref="IShellItem"/> that specifies the source item.
  220.         ''' </param>
  221.         '''
  222.         ''' <param name="pszNewName">
  223.         ''' Pointer to the new display name of the item. This is a null-terminated, Unicode string.
  224.         ''' </param>
  225.         '''
  226.         ''' <param name="pfopsItem">
  227.         ''' Pointer to an <see cref="IFileOperationProgressSink"/> object to be used
  228.         ''' for status and failure notifications.
  229.         ''' <para></para>
  230.         ''' If you call <see cref="IFileOperation.Advise"/> for the overall operation,
  231.         ''' progress status and error notifications for the rename operation are included there,
  232.         ''' so set this parameter to NULL.
  233.         ''' </param>
  234.         ''' ----------------------------------------------------------------------------------------------------
  235.         ''' <returns>
  236.         ''' If this method succeeds, it returns <see cref="HResult.S_OK"/>.
  237.         ''' Otherwise, it returns an <see cref="HResult"/> error code.
  238.         ''' </returns>
  239.         ''' ----------------------------------------------------------------------------------------------------
  240.         Function RenameItem(psiItem As IShellItem, <MarshalAs(UnmanagedType.LPWStr)> pszNewName As String, pfopsItem As IFileOperationProgressSink) As HResult
  241.  
  242.         ''' ----------------------------------------------------------------------------------------------------
  243.         ''' <summary>
  244.         ''' Declares a set of items that are to be given a new display name. All items are given the same name.
  245.         ''' </summary>
  246.         ''' ----------------------------------------------------------------------------------------------------
  247.         ''' <param name="pUnkItems">
  248.         ''' Pointer to the IUnknown of the IShellItemArray, IDataObject,
  249.         ''' or IEnumShellItems object which represents the group of items to be renamed.
  250.         ''' <para></para>
  251.         ''' You can also point to an IPersistIDList object to represent a single item,
  252.         ''' effectively accomplishing the same function as <see cref="IFileOperation.RenameItem"/>.
  253.         ''' </param>
  254.         '''
  255.         ''' <param name="pszNewName">
  256.         ''' Pointer to the new display name of the items. This is a null-terminated, Unicode string.
  257.         ''' </param>
  258.         ''' ----------------------------------------------------------------------------------------------------
  259.         ''' <returns>
  260.         ''' If this method succeeds, it returns <see cref="HResult.S_OK"/>.
  261.         ''' Otherwise, it returns an <see cref="HResult"/> error code.
  262.         ''' </returns>
  263.         ''' ----------------------------------------------------------------------------------------------------
  264.         Function RenameItems(<MarshalAs(UnmanagedType.Interface)> pUnkItems As Object, <MarshalAs(UnmanagedType.LPWStr)> pszNewName As String) As HResult
  265.  
  266.         ''' ----------------------------------------------------------------------------------------------------
  267.         ''' <summary>
  268.         ''' Declares a single item that is to be moved to a specified destination.
  269.         ''' </summary>
  270.         ''' ----------------------------------------------------------------------------------------------------
  271.         ''' <param name="psiItem">
  272.         ''' Pointer to an <see cref="IShellItem"/> that specifies the source item.
  273.         ''' </param>
  274.         '''
  275.         ''' <param name="psiDestinationFolder">
  276.         ''' Pointer to an <see cref="IShellItem"/> that specifies the destination folder to contain the moved item.
  277.         ''' </param>
  278.         '''
  279.         ''' <param name="pszNewName">
  280.         ''' Pointer to a new name for the item in its new location.
  281.         ''' <para></para>
  282.         ''' This is a null-terminated Unicode string and can be NULL.
  283.         ''' <para></para>
  284.         ''' If NULL, the name of the destination item is the same as the source.
  285.         ''' </param>
  286.         '''
  287.         ''' <param name="pfopsItem">
  288.         ''' Pointer to an <see cref="IFileOperationProgressSink"/> object to be used
  289.         ''' for progress status and error notifications for this specific move operation.
  290.         ''' <para></para>
  291.         ''' If you call <see cref="IFileOperation.Advise"/> for the overall operation,
  292.         ''' progress status and error notifications for the move operation are included there,
  293.         ''' so set this parameter to NULL.
  294.         ''' </param>
  295.         ''' ----------------------------------------------------------------------------------------------------
  296.         ''' <returns>
  297.         ''' If this method succeeds, it returns <see cref="HResult.S_OK"/>.
  298.         ''' Otherwise, it returns an <see cref="HResult"/> error code.
  299.         ''' </returns>
  300.         ''' ----------------------------------------------------------------------------------------------------
  301.         Function MoveItem(psiItem As IShellItem, psiDestinationFolder As IShellItem, <MarshalAs(UnmanagedType.LPWStr)> pszNewName As String, pfopsItem As IFileOperationProgressSink) As HResult
  302.  
  303.         ''' ----------------------------------------------------------------------------------------------------
  304.         ''' <summary>
  305.         ''' Declares a set of items that are to be moved to a specified destination.
  306.         ''' </summary>
  307.         ''' ----------------------------------------------------------------------------------------------------
  308.         ''' <param name="punkItems">
  309.         ''' Pointer to the <see cref="IUnknown"/> of the IShellItemArray, IDataObject,
  310.         ''' or IEnumShellItems object which represents the group of items to be moved.
  311.         ''' <para></para>
  312.         ''' You can also point to an IPersistIDList object to represent a single item,
  313.         ''' effectively accomplishing the same function as <see cref="IFileOperation.MoveItem"/>.
  314.         ''' </param>
  315.         '''
  316.         ''' <param name="psiDestinationFolder">
  317.         ''' Pointer to an <see cref="IShellItem"/> that specifies the destination folder to contain the moved items.
  318.         ''' </param>
  319.         ''' ----------------------------------------------------------------------------------------------------
  320.         ''' <returns>
  321.         ''' If this method succeeds, it returns <see cref="HResult.S_OK"/>.
  322.         ''' Otherwise, it returns an <see cref="HResult"/> error code.
  323.         ''' </returns>
  324.         ''' ----------------------------------------------------------------------------------------------------
  325.         Function MoveItems(<MarshalAs(UnmanagedType.Interface)> punkItems As Object, psiDestinationFolder As IShellItem) As HResult
  326.  
  327.         ''' ----------------------------------------------------------------------------------------------------
  328.         ''' <summary>
  329.         ''' Declares a single item that is to be copied to a specified destination.
  330.         ''' </summary>
  331.         ''' ----------------------------------------------------------------------------------------------------
  332.         ''' <param name="psiItem">
  333.         ''' Pointer to an <see cref="IShellItem"/> that specifies the source item.
  334.         ''' </param>
  335.         '''
  336.         ''' <param name="psiDestinationFolder">
  337.         ''' Pointer to an <see cref="IShellItem"/> that specifies the destination folder to contain the copy of the item.
  338.         ''' </param>
  339.         '''
  340.         ''' <param name="pszCopyName">
  341.         ''' Pointer to a new name for the item after it has been copied.
  342.         ''' This is a null-terminated Unicode string and can be NULL.
  343.         ''' <para></para>
  344.         ''' If NULL, the name of the destination item is the same as the source.
  345.         ''' </param>
  346.         '''
  347.         ''' <param name="pfopsItem">
  348.         ''' Pointer to an <see cref="IFileOperationProgressSink"/> object to be used
  349.         ''' for progress status and error notifications for this specific copy operation.
  350.         ''' <para></para>
  351.         ''' If you call <see cref="IFileOperation.Advise"/> for the overall operation,
  352.         ''' progress status and error notifications for the copy operation are included there,
  353.         ''' so set this parameter to NULL.
  354.         ''' </param>
  355.         ''' ----------------------------------------------------------------------------------------------------
  356.         ''' <returns>
  357.         ''' If this method succeeds, it returns <see cref="HResult.S_OK"/>.
  358.         ''' Otherwise, it returns an <see cref="HResult"/> error code.
  359.         ''' </returns>
  360.         ''' ----------------------------------------------------------------------------------------------------
  361.         Function CopyItem(psiItem As IShellItem, psiDestinationFolder As IShellItem, <MarshalAs(UnmanagedType.LPWStr)> pszCopyName As String, pfopsItem As IFileOperationProgressSink) As HResult
  362.  
  363.         ''' ----------------------------------------------------------------------------------------------------
  364.         ''' <summary>
  365.         ''' Declares a set of items that are to be copied to a specified destination.
  366.         ''' </summary>
  367.         ''' ----------------------------------------------------------------------------------------------------
  368.         ''' <param name="punkItems">
  369.         ''' Pointer to the <see cref="IUnknown"/> of the IShellItemArray, IDataObject,
  370.         ''' or IEnumShellItems object which represents the group of items to be copied.
  371.         ''' <para></para>
  372.         ''' You can also point to an IPersistIDList object to represent a single item,
  373.         ''' effectively accomplishing the same function as <see cref="IFileOperation.CopyItem"/>.
  374.         ''' </param>
  375.         '''
  376.         ''' <param name="psiDestinationFolder">
  377.         ''' Pointer to an <see cref="IShellItem"/> that specifies the destination folder to contain the copy of the items.
  378.         ''' </param>
  379.         ''' ----------------------------------------------------------------------------------------------------
  380.         ''' <returns>
  381.         ''' If this method succeeds, it returns <see cref="HResult.S_OK"/>.
  382.         ''' Otherwise, it returns an <see cref="HResult"/> error code.
  383.         ''' </returns>
  384.         ''' ----------------------------------------------------------------------------------------------------
  385.         Function CopyItems(<MarshalAs(UnmanagedType.Interface)> punkItems As Object, psiDestinationFolder As IShellItem) As HResult
  386.  
  387.         ''' ----------------------------------------------------------------------------------------------------
  388.         ''' <summary>
  389.         ''' Declares a single item that is to be deleted.
  390.         ''' </summary>
  391.         ''' ----------------------------------------------------------------------------------------------------
  392.         ''' <param name="psiItem">
  393.         ''' Pointer to an <see cref="IShellItem"/> that specifies the item to be deleted.
  394.         ''' </param>
  395.         '''
  396.         ''' <param name="pfopsItem">
  397.         ''' Pointer to an <see cref="IFileOperationProgressSink"/> object to be used
  398.         ''' for progress status and error notifications for this specific delete operation.
  399.         ''' <para></para>
  400.         ''' If you call <see cref="IFileOperation.Advise"/> for the overall operation,
  401.         ''' progress status and error notifications for the delete operation are included there,
  402.         ''' so set this parameter to NULL.
  403.         ''' </param>
  404.         ''' ----------------------------------------------------------------------------------------------------
  405.         ''' <returns>
  406.         ''' If this method succeeds, it returns <see cref="HResult.S_OK"/>.
  407.         ''' Otherwise, it returns an <see cref="HResult"/> error code.
  408.         ''' </returns>
  409.         ''' ----------------------------------------------------------------------------------------------------
  410.         Function DeleteItem(psiItem As IShellItem, pfopsItem As IFileOperationProgressSink) As HResult
  411.  
  412.         ''' ----------------------------------------------------------------------------------------------------
  413.         ''' <summary>
  414.         ''' Declares a set of items that are to be deleted.
  415.         ''' </summary>
  416.         ''' ----------------------------------------------------------------------------------------------------
  417.         ''' <param name="punkItems">
  418.         ''' Pointer to the <see cref="IUnknown"/> of the IShellItemArray, IDataObject,
  419.         ''' or IEnumShellItems object which represents the group of items to be deleted.
  420.         ''' <para></para>
  421.         ''' You can also point to an IPersistIDList object to represent a single item,
  422.         ''' effectively accomplishing the same function as <see cref="IFileOperation.DeleteItem"/>.
  423.         ''' </param>
  424.         ''' ----------------------------------------------------------------------------------------------------
  425.         ''' <returns>
  426.         ''' If this method succeeds, it returns <see cref="HResult.S_OK"/>.
  427.         ''' Otherwise, it returns an <see cref="HResult"/> error code.
  428.         ''' </returns>
  429.         ''' ----------------------------------------------------------------------------------------------------
  430.         Function DeleteItems(<MarshalAs(UnmanagedType.Interface)> punkItems As Object) As HResult
  431.  
  432.         ''' ----------------------------------------------------------------------------------------------------
  433.         ''' <summary>
  434.         ''' Declares a new item that is to be created in a specified location.
  435.         ''' </summary>
  436.         ''' ----------------------------------------------------------------------------------------------------
  437.         ''' <param name="psiDestinationFolder">
  438.         ''' Pointer to an <see cref="IShellItem"/> that specifies the destination folder that will contain the new item.
  439.         ''' </param>
  440.         '''
  441.         ''' <param name="dwFileAttributes">
  442.         ''' A bitwise value that specifies the file system attributes for the file or folder.
  443.         ''' </param>
  444.         '''
  445.         ''' <param name="pszName">
  446.         ''' Pointer to the file name of the new item, for instance Newfile.txt. This is a null-terminated, Unicode string.
  447.         ''' </param>
  448.         '''
  449.         ''' <param name="pszTemplateName">
  450.         ''' Pointer to the name of the template file (for example Excel9.xls) that the new item is based on,
  451.         ''' stored in one of the following locations:
  452.         ''' <para></para>
  453.         '''   - CSIDL_COMMON_TEMPLATES. The default path for this folder is %ALLUSERSPROFILE%\Templates.
  454.         ''' <para></para>
  455.         '''   - CSIDL_TEMPLATES. The default path for this folder is %USERPROFILE%\Templates.
  456.         ''' <para></para>
  457.         '''   - %SystemRoot%\shellnew
  458.         ''' <para></para>
  459.         ''' This is a null-terminated, Unicode string used to specify an existing file of the same type as the new file,
  460.         ''' containing the minimal content that an application wants to include in any new file.
  461.         ''' <para></para>
  462.         ''' This parameter is normally NULL to specify a new, blank file.
  463.         ''' </param>
  464.         '''
  465.         ''' <param name="pfopsItem">
  466.         ''' Pointer to an <see cref="IFileOperationProgressSink"/> object to be used
  467.         ''' for status and failure notifications.
  468.         ''' <para></para>
  469.         ''' If you call <see cref="IFileOperation.Advise"/> for the overall operation,
  470.         ''' progress status and error notifications for the creation operation are included there,
  471.         ''' so set this parameter to NULL.
  472.         ''' </param>
  473.         ''' ----------------------------------------------------------------------------------------------------
  474.         ''' <returns>
  475.         ''' If this method succeeds, it returns <see cref="HResult.S_OK"/>.
  476.         ''' Otherwise, it returns an <see cref="HResult"/> error code.
  477.         ''' </returns>
  478.         ''' ----------------------------------------------------------------------------------------------------
  479.         Function NewItem(psiDestinationFolder As IShellItem, dwFileAttributes As FileAttributes, <MarshalAs(UnmanagedType.LPWStr)> pszName As String, <MarshalAs(UnmanagedType.LPWStr)> pszTemplateName As String, pfopsItem As IFileOperationProgressSink) As HResult
  480.  
  481.         ''' ----------------------------------------------------------------------------------------------------
  482.         ''' <summary>
  483.         ''' Executes all selected operations.
  484.         ''' </summary>
  485.         ''' ----------------------------------------------------------------------------------------------------
  486.         ''' <returns>
  487.         ''' If this method succeeds, it returns <see cref="HResult.S_OK"/>.
  488.         ''' Otherwise, it returns an <see cref="HResult"/> error code.
  489.         ''' <para></para>
  490.         ''' Note that if the operation was canceled by the user, this method can still return a success code.
  491.         ''' <para></para>
  492.         ''' Use the <see cref="IFileOperation.GetAnyOperationsAborted"/> function to determine if this was the case.
  493.         ''' </returns>
  494.         ''' ----------------------------------------------------------------------------------------------------
  495.         Function PerformOperations() As HResult
  496.  
  497.         ''' ----------------------------------------------------------------------------------------------------
  498.         ''' <summary>
  499.         ''' Gets a value that states whether any file operations initiated
  500.         ''' by a call to <see cref="IFileOperation.PerformOperations"/> were stopped before they were complete.
  501.         ''' <para></para>
  502.         ''' The operations could be stopped either by user action or silently by the system.
  503.         ''' </summary>
  504.         ''' ----------------------------------------------------------------------------------------------------
  505.         ''' <param name="pfAnyOperationsAborted">
  506.         ''' When this method returns, points to <see langword="True"/> if any file operations were
  507.         ''' aborted before they were complete; otherwise, <see langword="False"/>.
  508.         ''' </param>
  509.         ''' ----------------------------------------------------------------------------------------------------
  510.         ''' <returns>
  511.         ''' If this method succeeds, it returns <see cref="HResult.S_OK"/>.
  512.         ''' Otherwise, it returns an <see cref="HResult"/> error code.
  513.         ''' </returns>
  514.         ''' ----------------------------------------------------------------------------------------------------
  515.         Function GetAnyOperationsAborted(<[Out]> <MarshalAs(UnmanagedType.Bool)> pfAnyOperationsAborted As Boolean) As HResult
  516.  
  517.     End Interface
  518.  
  519. End Namespace
  520.  
  521. #End Region
  522.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement