键盘挂钩:更改键码
我确实将某个过程的键盘连接起来。现在,我需要更改发送到该过程的关键消息。
例如:从小写到大写,相反。
我该怎么做?
I did hook the keyboard of some process. Now I need to change the key message sent to the process.
For example: from lowercase to uppercase and opposite.
How can I do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
假设您的功能原型如下:
LRESULT CALLBACK WndProc( HWND hWnd, UING uMsg, WPARAM wParam, LPARAM lParam )
,您的字母的价值在WPARAM内部。假设纯ASCII键盘输入,那么您可以使用以下内容:
当然,如果您在2000年以上的Windows系统上(因此在NT架构上运行),WPARAM将是Unicode值(和UTF-16) the Windows convention), so your program may have to fiddle with this to get it into a nice state, but otherwise this should be all you need.
Assuming your function prototype is as follows:
LRESULT CALLBACK WndProc( HWND hWnd, UING uMsg, WPARAM wParam, LPARAM lParam )
,the value of your letter is inside wParam. Assuming pure ASCII keyboard input, then you can use the following:
Of course, if you're on a Windows system beyond 2000 (and thus running on the NT architecture), wParam will be a Unicode value (and UTF-16, as is the Windows convention), so your program may have to fiddle with this to get it into a nice state, but otherwise this should be all you need.