关于WH_JOURNALPLAYBACK挂钩冻结直到移动鼠标的问题 [英] Question about WH_JOURNALPLAYBACK hook freezing up until mouse is moved

查看:94
本文介绍了关于WH_JOURNALPLAYBACK挂钩冻结直到移动鼠标的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前在XP中.我尝试使用该钩子来回放一些记录的用户操作,但是尝试对它计时,以使应该在创建某些窗口之后执行的操作延迟到创建这些窗口之前.我返回任意延迟 (10)如果尚未创建正在等待的窗口,则会显示HC_GETNEXT.

I'm currently in XP. I try to use the hook to playback some recorded user actions, but try to time it so that actions that are supposed to come after the creation of certain windows are delayed until those windows are created. I return an arbitrary delay (10) when I get HC_GETNEXT if the window I'm waiting for hasn't been created.

有时候,播放只是随机暂停,然后尝试仅在我轻推鼠标时赶上.我不认为这些情况是由于我正在等待窗口创建而导致的,因为我可以跟踪它必须延迟多少次 因此,这个数字并没有增加.

Sometimes the playback would just randomly pause, and then try to catch up only when I nudge the mouse. I don't think these cases are caused by the fact that I'm waiting for window creations, because I can keep track of how many times it had to be delayed due to that, and that number isn't increasing.

有什么想法吗?

推荐答案

嗨邦特雷,

最好的建议是使用现代自动化API而不是日记钩.除其他优点外,这将允许在通知已创建目标窗口的情况下进行操作,而不是尝试对其进行精确计时.
请参阅: http://msdn.microsoft.com/en-us/library/ff486375.aspx

The best recommendation is to use the modern automation API rather than journal hooks.  Among other advantages, this will allow acting on a notification that the target window has been created rather than trying to time it accurately.
See: http://msdn.microsoft.com/en-us/library/ff486375.aspx

Journal hooks是为Win16的协作式多任务系统设计的,与现代OS不能很好地配合.它们需要同步桌面的所有输入,并且存在安全性问题,这些问题将其限制为只能通过特殊访问权限运行 在Vista和更高版本上.

Journal hooks were designed for the collaborative multitasking system from Win16 and do not mesh well with modern OSes.  They require synchronizing all input for the desktop and have security issues which limit them to running only with special access on Vista and later.

这听起来像是一个已知问题,其中处理延迟的内部计时器唤醒了错误的线程,因此未检测到合成消息.轻推鼠标生成新消息将唤醒线程并允许所有消息被删除. 抽.我相信这对于Windows 7是固定的.

That said, sounds like a known issue where the internal timer which handles the delay wakes the wrong thread so the synthesized message isn't detected.  Generating a new message by nudging the mouse will wake the thread and allow all messages to be pumped.  I believe this was fixed for Windows 7.

如果这是相同的问题,则使用日志挂钩的唯一解决方案是不从HC_GETNEXT返回延迟.同样,最好避免使用日记帐挂钩.

If this is the same issue, the only solution with the journal hook is not to return a delay from HC_GETNEXT.  Again though, journal hooks are best avoided.

希望这会有所帮助,

基思·芬克
Microsoft在线社区支持

Keith Fink
Microsoft Online Community Support


这篇关于关于WH_JOURNALPLAYBACK挂钩冻结直到移动鼠标的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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