VC ++:如何挂接/解开特定的单线程 [英] VC++ : how to hook/unhook a particular single thread

查看:59
本文介绍了VC ++:如何挂接/解开特定的单线程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我们正在钩住 GLOBAL 的TextOut(),ExtTextOut()和DrawText()方法.


hhook = SetWindowsHookEx(WH_CBT, function_address, module_handle, 0);

但是我们只想钩住/解开一个特定的exe文件.有人可以告诉我们如何检查所有现有线程并获取所需的exe文件,然后仅对其进行挂接/取消挂接.

请提供帮助.

谢谢

Hi,

We are hooking TextOut(),ExtTextOut() and DrawText() methods GLOBALLY .

i.e.
hhook = SetWindowsHookEx(WH_CBT, function_address, module_handle, 0);

But we want to hook/unhook only a particular exe. Can someone tell us how to check all the existing threads and get the required exe and hook/unhook only that.

Please provide help.

Thank you

推荐答案

如果您要查找exe,则不必检查所有线程.您只需要枚举这些过程.希望文章枚举所有进程 [
If you want to find the exe you don''t have to check all threads. You just need to enumerate the processes. Hope the article Enumerating All Processes[^] in MSDN will help you.


您也可以调用GetModuleFileName [
You may also call GetModuleFileName [^] and act accordingly.
:)


您能告诉我如何钩住TextOut(),ExtTextOut()和DrawText()方法吗?我需要做同样的事情,而且不知道该怎么做.
Can you show me how you are hooking the TextOut(),ExtTextOut() and DrawText() methods? I am needing to do the same thing, and do not know how.


这篇关于VC ++:如何挂接/解开特定的单线程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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