如何在Explorer的重命名事件中挂钩C ++ [英] How to hook C++ in Explorer's rename event

查看:147
本文介绍了如何在Explorer的重命名事件中挂钩C ++的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不能比我的头衔更清楚。 :P



每当用户在Windows资源管理器中重命名文件(并且只在资源管理器中)时,我想运行我的程序。下面是一个简单的模拟:





指向教程的简单链接将非常有用。我找不到什么。 :/



提前感谢。



我是C ++的新用户

解决方案

看起来Windows API挂钩可能是你最好的选择。您将要拦截与Windows文件重命名相关的所有调用(即MoveFile,MoveFileEx,SHFileOperation,可能更多)。有一些商业和开源解决方案; Microsoft Detours Madshi的madCodeHook 和免费的开源 EasyHook



这种方法在正确完成后,将允许捕获系统上的所有文件重命名。


I can't be clearer than my title. :P

I want to run my program whenever a user renames a file in Windows Explorer (and only within the Explorer). Here's a simple mock up:

A simple link to a tutorial will be very helpful. I couldn't find anything. :/

Thank you in advance.

P.S. I'm new in C++

解决方案

It looks like Windows API hooking may be your best bet. You'll want to intercept all calls related to Windows file renaming (i.e. MoveFile, MoveFileEx, SHFileOperation, possibly more). There are a few commercial and open source solutions; Microsoft Detours, Madshi's madCodeHook, and the free, open source EasyHook.

This approach, when done correctly, will allow you to capture all file renaming on a system.

这篇关于如何在Explorer的重命名事件中挂钩C ++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆