想问一下关于防止文件复制的问题。

xitianjile 2005-04-11 03:39:38
监视一个指定的文件夹,用户要往这个文件夹里复制东西,就弹出一个框,要确认往里复制。
点击确认则开始复制,点击取消的取消复制!
谢谢各位了!
不知道这样会不会太难呢。。
...全文
352 17 打赏 收藏 转发到动态 举报
写回复
用AI写文章
17 条回复
切换为时间正序
请发表友善的回复…
发表回复
xitianjile 2005-04-13
  • 打赏
  • 举报
回复
算了也没什么好的答案。
结帐
pepsi1980 2005-04-12
  • 打赏
  • 举报
回复
有点麻烦,关注!
zhjie374 2005-04-12
  • 打赏
  • 举报
回复
file system filter

xitianjile 2005-04-12
  • 打赏
  • 举报
回复
其实我希望不是用类来实现的。
xitianjile 2005-04-12
  • 打赏
  • 举报
回复
希望寻求更多的答案!!
xitianjile 2005-04-11
  • 打赏
  • 举报
回复
mark一下。。
oyljerry 2005-04-11
  • 打赏
  • 举报
回复
SHChangeNotifyRegister
xitianjile 2005-04-11
  • 打赏
  • 举报
回复
谢谢楼上的。
过两天在结帐。
DentistryDoctor 2005-04-11
  • 打赏
  • 举报
回复
ICopyHook::CopyCallback Method

--------------------------------------------------------------------------------

Determines whether the Shell will be allowed to move, copy, delete, or rename a folder or printer object.

Syntax

UINT CopyCallback( HWND hwnd,
UINT wFunc,
UINT wFlags,
LPCTSTR pszSrcFile,
DWORD dwSrcAttribs,
LPCTSTR pszDestFile,
DWORD dwDestAttribs
);
Parameters

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 folder.
dwSrcAttribs
Attributes of the source folder. This parameter can be a combination of any of the file attribute flags (FILE_ATTRIBUTE_*) defined in the Microsoft Windows header files.
pszDestFile
Address of a string that contains the name of the destination folder.
dwDestAttribs
Attributes of the destination folder. 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 folder 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.


Remarks

The Shell calls each copy hook handler registered for a folder or printer object until all the handlers have been called or until one of them returns IDNO or IDCANCEL.

Copy hook handlers for folders are registered under the following key.

HKEY_CLASSES_ROOT
Directory
Shellex
CopyHookHandlers
your_copyhook
(Default) = {copyhook CLSID value}
Copy hook handlers for printers are registered under the following key.
HKEY_CLASSES_ROOT
Printers
Shellex
CopyHookHandlers
your_copyhook
(Default) = {copyhook CLSID value}

When this method is called, the Shell initializes the ICopyHook interface directly without using an IShellExtInit interface first.

xitianjile 2005-04-11
  • 打赏
  • 举报
回复
有那种钩子吗?
我们以前那个老总(中科院的研究员)说很容易实现,可是问他,他支支吾吾的。
关键是我要实现的是先弹出个框,确定后在允许或者拦击!
DentistryDoctor 2005-04-11
  • 打赏
  • 举报
回复
还有一种方法是所谓的拷贝钩子处理。

Windows Sheel编程指南与实例一书第四章专门讲这个。
DentistryDoctor 2005-04-11
  • 打赏
  • 举报
回复
Hook应该是可以实现,但是是说起来容易,实现起来还是有难度的。

建议从文件的安全属性出发。
xitianjile 2005-04-11
  • 打赏
  • 举报
回复
hook??
能否提供一点思路?
在那个hook里嵌入CreateFile?
jerry 2005-04-11
  • 打赏
  • 举报
回复
可能要 API HOOK. 我没做过

15,471

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 进程/线程/DLL
社区管理员
  • 进程/线程/DLL社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧