На главную

On-line справка по Win32 API

Написать письмо
БЕСПЛАТНАЯ ежедневная online лотерея! Выигрывай каждый день БЕСПЛАТНО!
Список всех статей A-B-C-D-E-F-G-H-I-J-K-L-M-N-O-P-Q-R-S-T-U-V-W-X-Y-Z | Скачать Вниз

ICopyHook::CopyCallback



[Now Supported on Windows NT]

Either allows the shell to move, copy, delete, or rename a folder or printer object, or disallows the shell from carrying out the operation. The shell calls each copy hook handler registered (see Comments below) for a folder or printer object until either all the handlers have been called or one of them returns IDCANCEL.

UINT CopyCallback(

HWND hwnd, //Handle of the parent window for displaying UI objects
UINT wFunc, //Operation to perform.
UINT wFlags, //Flags that control the operation
LPCSTR pszSrcFile, //Pointer to the source file
DWORD dwSrcAttribs, //Source file attributes
LPCSTR pszDestFile, //Pointer to the destination file
DWORD dwDestAttribs //Destination file attributes
);


Parameters

hwnd

Handle of the window that the copy hook handler should use as the parent window 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 following values:

FO_COPY
0x0002 Copies the file specified by pszSrcFile to the location specified by pszDestFile.
FO_DELETE
0x0003 Deletes the file specified by pszSrcFile.
FO_MOVE
0x0001 Moves the file specified by pszSrcFile to the location specified by pszDestFile.
FO_RENAME
0x0004 Renames the file specified by pszSrcFile.
PO_DELETE
0x0013 Deletes the printer specified by pszSrcFile.
PO_PORTCHANGE
0x0020 Changes the printer port. The pszSrcFile and pszDestFile parameters contain double null-terminated lists of strings. Each list contains the printer name followed by the port name. The port name in pszSrcFile is the current printer port, and the port name in pszDestFile is the new printer port.
PO_RENAME
0x0014 Renames the printer specified by pszSrcFile.
PO_REN_PORT
0x0034 Combination of PO_RENAME and PO_PORTCHANGE.


wFlags

Flags that control the operation. This parameter can be a combination of the following values:

FOF_ALLOWUNDO
0x0040 Preserves undo information (when possible).
FOF_CONFIRMMOUSE
0x0002 Not implemented.
FOF_FILESONLY
0x0080 Not implemented. The shell calls a copy hook handler only for folder objects, not files.
FOF_MULTIDESTFILES
0x0001 The SHFileOperation function specified multiple destination files (one for each source file) rather than one directory where all the source files are to be deposited. A copy hook handler typically ignores this value.
FOF_NOCONFIRMATION
0x0010 Responds with "yes to all" for any dialog box that is displayed.
FOF_NOCONFIRMMKDIR
0x0200 Does not confirm the creation of any needed directories if the operation requires a new directory to be created.
FOF_RENAMEONCOLLISION
0x0008 Gives the file being operated on a new name, such as, "Copy #1 of ...", in a copy, move, or rename operation when a file with the target name already exists.
FOF_SILENT
0x0004 Displays no progress dialog box.
FOF_SIMPLEPROGRESS
0x0100 Displays a progress dialog box, but the dialog box does not show the names of the files.


pszSrcFile

Pointer to 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

Pointer to 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.

Return Value

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 (for example, a batch copy operation).

IDCANCEL

Prevents the current operation and cancels any pending operations.

Comments

You need to register your copyhook handler. For example, …\directory copyhook 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.
The shell initializes the ICopyHook interface directly, when ICopyHook::CopyCallback is called, without using an IShellExtInit or IPersistFile interface first.

See Also

ICopyHook, SHFileOperation


Пригласи друзей и счет твоего мобильника всегда будет положительным!
Предыдущая статья
 
Сайт Народ.Ру Интернет
Следующая статья
Пригласи друзей и счет твоего мобильника всегда будет положительным!

ICopyHook::CopyCallback



[Теперь Поддерживанное на Windows NT]

Также позволяет оболочку, чтобы перемещать, копировать, удалять, или переименовывать папку или объект принтера или отвергает оболочку чтобы выполнять действие. Оболочка называет каждый рычажный вручитель зарегистрированный копия (смотри Комментарии ниже) для папка или объект принтер до или все вручители назван или один из них возвращает IDCANCEL.

UINT CopyCallback(

HWND hwnd, //РУЧКА родительского окна для отображения UI возражает UINT wFunc, //Действию, чтобы выполняться.
UINT wFlags, //ФЛАГИ, что управлять действием LPCSTR pszSrcFile, //Указателем в исходный файл DWORD dwSrcAttribs, //атрибуты файла Источника LPCSTR pszDestFile, //Указателя в файл расположения DWORD dwDestAttribs //атрибуты файла Расположения
);


Параметры

hwnd

Прооперируйте окно, что рычажный вручитель копии должен использовать как родительское окно для любого интерфейса пользавателя элементов вручитель возможно нужно отображаться. Если FOF_SILENT определен, метод должен проигнорировать этот параметр.

wFunc

Действие, чтобы выполняться. Этот параметр может быть одним из следующего величин:

FO_COPY
0x0002 Копирует файл определенный pszSrcFile в позицию определенную pszDestFile.
FO_DELETE
0x0003 Удаляет файл определенный pszSrcFile.
FO_MOVE
0x0001 Перемещает файл определенный pszSrcFile в позицию определенную pszDestFile.
FO_RENAME
0x0004 Переименовывает файл определенный pszSrcFile.
PO_DELETE
0x0013 Удаляет принтер определенный pszSrcFile.
PO_PORTCHANGE
0x0020 Изменяет порт принтера. pszSrcFile И параметры pszDestFile содержат недействительный расторгнутые списки двойного количества строк. Каждый список содержит имя принтера сопровожденное именем порта. Имя порта в pszSrcFile - текущий порт принтера, и имя порта в pszDestFile - новый порт принтера.
PO_RENAME
0x0014 Переименовывает принтер определенный pszSrcFile.
PO_REN_PORT
0x0034 Комбинация PO_RENAME и PO_PORTCHANGE.


wFlags

Флаги, что управлять действием. Этот параметр может быть комбинацией следующего величин:

FOF_ALLOWUNDO
0x0040 Сохраняет информацию отмены (когда возможно).
FOF_CONFIRMMOUSE 0x0002 Не осуществлялся.
FOF_FILESONLY
0x0080 Не осуществлялся. Оболочка призывает рычажного вручителя копии только к объектам папки, не файлов.
FOF_MULTIDESTFILES
0x0001 функция SHFileOperation определяла многочисленным файлам расположения (за каждого исходного файла) а не один директорий где все исходные файлы должны быть депонированы. Рычажный вручитель копии обычно игнорирует эту величину.
FOF_NOCONFIRMATION
0x0010 Указывает "да им" для любого диалогового блока, который отображен.
FOF_NOCONFIRMMKDIR
0x0200 не подтверждает создание любых директориев нужно если операция требует новый директорий, который нужно создаваться.
FOF_RENAMEONCOLLISION
0x0008 Дает файл, обслуживанный в новом имени, как например,, "Копия #1...", в копии, перемещении или переименовывать операцию когда файл с целевым именем уже существует.
FOF_SILENT
0x0004 не Отображает никакого диалогового блока прогресса.
FOF_SIMPLEPROGRESS
0x0100 Отображает диалогового блока прогресса, но диалоговый блок не показывает имена файлов.


pszSrcFile

Указатель в строку, которая содержит имя исходного файла.

dwSrcAttribs

Атрибуты исходного файла. Этот параметр может быть комбинацией любого из атрибута файла флагов (FILE_ATTRIBUTE_*) определенное в файлах заголовка Windows.

pszDestFile

Указатель в строку, которая содержит имя файла расположения.

dwDestAttribs

Атрибуты файла расположения. Этот параметр может быть комбинацией любого из атрибута файла флагов (FILE_ATTRIBUTE_*) определенное в файлах заголовка Windows.

Обратная Величина

Возвращает величину целого, которая указывает должна оболочка выполнить операцию. Это может быть одним из следующего: IDYES

Допускает операцию.

IDNO

Предотвращает операцию в этом файле но продолжает любые другие операции (например, пакетная операция копии).

IDCANCEL

Предотвращает текущую операцию и отменяет любые незаконченные операции.

Комментарии

Вам нужно регистрировать вашего copyhook вручителя. Например, \директория copyhook вручители зарегистрирован под HKEY_CLASSES_ROOT\directory\shellex\CopyHookHandlers\your_copyhook\{copyhook CLSID оценивать}. Другие клавиши регистрации связанные расширениями оболочки: *, Папка, Накопители, Принтеры, Неизвестные, и AudioCD.
Оболочка инициализирует интерфейс ICopyHook непосредственно, когда ICopyHook::CopyCallback назван, не используя IShellExtInit или интерфейс IPersistFile сначала.

Смотри Также

ICopyHook, SHFileOperation


Вверх Version 1.3, Oct 26 2010 © 2007, 2010, mrhx Вверх
 mrhx software  Русский перевод OpenGL  Русский перевод Win32 API
 
Используются технологии uCoz