Tag: systemevent

按Tab键几次后不再调用线程钩子程序。 为什么?

我安装了一个特定于线程的窗口挂钩来监视发送到WndProc的消息。 它起初工作。 然而,在我按Tab键约19次以在表单周围移动焦点后,我的钩子回调不再被调用。 这种情况发生了我是快速还是慢速按Tab键的问题。 谁能解释一下究竟发生了什么? 下面是我写的代码。 我在Windows 7 64位上测试过它。 using System; using System.Collections.Generic; using System.Linq; using System.Windows.Forms; using System.Runtime.InteropServices; namespace HookTest { static class Program { private const int WH_CALLWNDPROC = 4; private delegate IntPtr HookProc(int nCode, IntPtr wParam, IntPtr lParam); private class MainForm : Form { private Button button1; private TextBox textBox1; public MainForm() […]