钩子在"windiows 7"窗口中停顿一段时间后会自动停止.操作系统,但在Vista和XP中可以正常工作 [英] Hooks is getting stopped automatically after a while in "windiows 7" OS, But its works fine in Vista and XP

查看:141
本文介绍了钩子在"windiows 7"窗口中停顿一段时间后会自动停止.操作系统,但在Vista和XP中可以正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

乔治,

引用链接:在C#中处理全局鼠标和键盘挂钩 [

私有void HookManager_KeyPress(object sender,KeyPressEventArgs e)
{
textBoxLog.AppendText(string.Format("KeyPress-{0} \ n",e.KeyChar));
textBoxLog.ScrollToCaret();
CaptureScreen.CaptureScreen.GetDesktopImage();
}

任何运气为什么会发生这种情况?

注意:这在我的Vista和Xp机器上正常工作

最好的问候
Prasanth.k
[已删除电子邮件地址]

Hi george,

refering link :Processing Global Mouse and Keyboard Hooks in C#[^]

i have added "CaptureScreen.CaptureScreen.GetDesktopImage();" as last line of the _keyPress event, the hook is getting stopped automatically after a while in Windows 7 Operating system.


private void HookManager_KeyPress(object sender, KeyPressEventArgs e)
{
textBoxLog.AppendText(string.Format("KeyPress - {0}\n", e.KeyChar));
textBoxLog.ScrollToCaret();
CaptureScreen.CaptureScreen.GetDesktopImage();
}

any luck why this happens?

Note: This works fine on my vista and Xp machine

Best regards
Prasanth.k
[Email address removed]

推荐答案

您为什么在此处发布与文章相关的查询?请使用本文底部的留言板来讨论相关问题.

这样可以确保您的查询引起文章作者的注意,并且更有可能获得帮助.
Why have you posted a query that''s related to an article here? PLEASE use the message board at the bottom of the article to discuss related issues.

That will ensure that your query gets the attention of the article author and you''ll have a higher chance of being helped.


这篇关于钩子在"windiows 7"窗口中停顿一段时间后会自动停止.操作系统,但在Vista和XP中可以正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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