IFolderWindowsGetFolderOperationControlAsync Method |
IT Hit User File System
Method returns whether the Shell should perform the operation.
Namespace:
ITHit.FileSystem.Windows
Assembly:
ITHit.FileSystem.Windows (in ITHit.FileSystem.Windows.dll) Version: 8.4.27341.0
Syntax Task<FolderOperationControl> GetFolderOperationControlAsync(
FolderOperation fileOperation,
string targetUserFileSystemPath,
IntPtr parentWindow,
FolderControlFlags flags,
FileAttributes sourceAttributes,
FileAttributes targetAttributes
)
Function GetFolderOperationControlAsync (
fileOperation As FolderOperation,
targetUserFileSystemPath As String,
parentWindow As IntPtr,
flags As FolderControlFlags,
sourceAttributes As FileAttributes,
targetAttributes As FileAttributes
) As Task(Of FolderOperationControl)
Task<FolderOperationControl>^ GetFolderOperationControlAsync(
FolderOperation fileOperation,
String^ targetUserFileSystemPath,
IntPtr parentWindow,
FolderControlFlags flags,
FileAttributes sourceAttributes,
FileAttributes targetAttributes
)
abstract GetFolderOperationControlAsync :
fileOperation : FolderOperation *
targetUserFileSystemPath : string *
parentWindow : IntPtr *
flags : FolderControlFlags *
sourceAttributes : FileAttributes *
targetAttributes : FileAttributes -> Task<FolderOperationControl>
Parameters
- fileOperation
- Type: ITHit.FileSystem.WindowsFolderOperation
The operation to perform.
- targetUserFileSystemPath
- Type: SystemString
Name of the destination folder. This parameter is provided for copy, move and rename operations only. Null for all other operations.
- parentWindow
- Type: SystemIntPtr
A handle to the window that the copy hook handler should use as the parent for
any user interface elements the handler may need to display. If FOF_SILENT is specified in operation,
the method should ignore this parameter.
- flags
- Type: ITHit.FileSystem.WindowsFolderControlFlags
The flags that control the operation FolderControlFlags enum.
- sourceAttributes
- Type: System.IOFileAttributes
The attributes of the source folder.
- targetAttributes
- Type: System.IOFileAttributes
The attributes of the destination folder.
Return Value
Type:
TaskFolderOperationControl
Value that indicates whether the Shell should perform the operation.
Remarks
To allow or forbid Shell from performing operations, follow these steps:
-
Derive your class from one of the [!:StorageProviderCopyHookBase] class descendants.
Add the GuidAttribute,
ProgIdAttribute and
ComVisibleAttribute attributes to your class.
You do not need to implement any methods in your class.
-
Register the COM server in your Package.appxmanifest (in case of packaged app).
-
To register a copy hook handler for cloud folders, call the [!:ShellExtensionRegistrar.RegisterHandler]
passing "CopyHook" as a handler name.
Note that unlike other handlers, CopyHook must be registered in all cases, regardless if your app is running with or without identity.
-
Implement the GetFolderOperationControlAsync(FolderOperation, String, IntPtr, FolderControlFlags, FileAttributes, FileAttributes) with your logic.
CopyHook functionality does NOT require package or application identity.
Examples The code below is part of 'VirtualDrive' C# sample provided with the SDK.
[ComVisible(true)]
[ProgId("VirtualDrive.StorageProviderCopyHook")]
[Guid("4E813313-2227-42AE-BDC9-53C17A9CF812")]
internal class StorageProviderCopyHookIntegrated : StorageProviderCopyHookIntegratedBase
{
public StorageProviderCopyHookIntegrated() : base(Program.Engine)
{
}
}
The code below is part of 'VirtualDrive' C# sample provided with the SDK.
<Extensions>
<desktop3:Extension Category="windows.cloudFiles">
<desktop3:CloudFiles>
<desktop3:CustomStateHandler Clsid="000562AA-2879-4CF1-89E8-0AEC9596FE19"/>
<desktop3:ThumbnailProviderHandler Clsid="05CF065E-E135-4B2B-9D4D-CFB3FBAC73A4"/>
<desktop3:ExtendedPropertyHandler Clsid="20000000-0000-0000-0000-000000000001"/>
<desktop3:BannersHandler Clsid="20000000-0000-0000-0000-000000000001"/>
<desktop3:CloudFilesContextMenus>
<desktop3:Verb Id="LockCommand" Clsid="9C923BF3-3A4B-487B-AB4E-B4CF87FD1C25" />
</desktop3:CloudFilesContextMenus>
<desktop4:ContentUriSource Clsid="6D45BC7A-D0B7-4913-8984-FD7261550C08"/>
</desktop3:CloudFiles>
</desktop3:Extension>
<com:Extension Category="windows.comServer">
<com:ComServer>
<com:ExeServer DisplayName="VirtualDrive" Executable="dummy.exe">
<com:Class Id="05CF065E-E135-4B2B-9D4D-CFB3FBAC73A4" />
</com:ExeServer>
<com:ExeServer DisplayName="VirtualDrive" Executable="dummy.exe">
<com:Class Id="9C923BF3-3A4B-487B-AB4E-B4CF87FD1C25" />
</com:ExeServer>
<com:ExeServer DisplayName="VirtualDrive" Executable="dummy.exe">
<com:Class Id="000562AA-2879-4CF1-89E8-0AEC9596FE19" />
</com:ExeServer>
<com:ExeServer DisplayName="VirtualDrive" Executable="dummy.exe">
<com:Class Id="6D45BC7A-D0B7-4913-8984-FD7261550C08" />
</com:ExeServer>
</com:ComServer>
</com:Extension>
</Extensions>
See Also