rt
运行平台:windows mobile 5.0
------解决方案--------------------
WinCE上支持三种类型的Hook
#define WH_JOURNALRECORD 0
#define WH_JOURNALPLAYBACK 1
#define WH_KEYBOARD_LL 20
不过前两个使用的时候是使用如下函数:
QASetWindowsJournalHook
QAUnhookWindowsJournalHook
后者使用SetWindowsHookExW和UnhookWindowsHookEx
------解决方案--------------------
在后台运行就简单了
捕捉按键,发送另外一个按键如下:
using System.Runtime.InteropServices;
[DllImport( "coredll.dll ", EntryPoint = "keybd_event ", SetLastError = true)]
internal static extern void Keyboard_Event(byte bVk, byte bScan, int dwFlags, int dwExtraInfo);
给Form添加KeyDown事件:
private void Form_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
{
if(e.KeyValue == Keys.Tab)
{
//按下tab键后,转为enter
Keyboard_Event(13, 0, 0, 0);
}
}