Contents Index Topic Contents | ||
Previous Topic: ICopyHook Next Topic: IDeskBand |
ICopyHook::CopyCallback
UINT CopyCallback( HWND hwnd, UINT wFunc, UINT wFlags, LPCSTR pszSrcFile, DWORD dwSrcAttribs, LPCSTR pszDestFile, DWORD dwDestAttribs );Determines whether the shell will be allowed to move, copy, delete, or rename a folder or printer object. The shell calls each copy hook handler registered (see comments below) for a folder or printer object until all the handlers have been called or until one of them returns IDNO or IDCANCEL.
- Returns an integer value that indicates whether or not the shell should perform the operation. It can be one of the following:
IDYES Allows the operation. IDNO
Prevents the operation on this file but continues with any other operations that have been approved (for example, a batch copy operation). IDCANCEL Prevents the current operation and cancels any pending operations.
- hwnd
- 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, the method should ignore this parameter.
- wFunc
- Operation to perform. This parameter can be one of the values listed under the wFunc member of the SHFILEOPSTRUCT structure.
- wFlags
- Flags that control the operation. This parameter can be one or more of the values listed under the fFlags member of the SHFILEOPSTRUCT structure.
- pszSrcFile
- Address of a string that contains the name of the source file.
- dwSrcAttribs
- Attributes of the source file. This parameter can be a combination of any of the file attribute flags (FILE_ATTRIBUTE_*) defined in the Windows header files.
- pszDestFile
- Address of a string that contains the name of the destination file.
- dwDestAttribs
- Attributes of the destination file. This parameter can be a combination of any of the file attribute flags (FILE_ATTRIBUTE_*) defined in the Windows header files.
You need to register your copy hook handler. For example, directory copy hook handlers are registered under HKEY_CLASSES_ROOT\directory\shellex\CopyHookHandlers\your_copyhook\{copyhook CLSID value}. Other registry keys associated with shell extensions are: *, Folder, Drives, Printers, Unknown, and AudioCD.
When this method is called, the shell initializes the ICopyHook interface directly without using an IShellExtInit interface first.
See also SHFileOperation
Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.