LPARAM,WPARAM查询 [英] LPARAM, WPARAM Queries

查看:126
本文介绍了LPARAM,WPARAM查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


有人可以解释在键盘挂钩中产生击键时如何检索lparam和wparam变量的值并对其进行修改吗?

在此先感谢

Hi,
Can Any one explain how to retrieve the value and modify it of lparam, wparam variable when keystrokes are generated in keyboard hooks?

Thanks in advance

推荐答案

通常,它是通过覆盖PreTranslateMessage函数来完成的:

应用级别:
http://msdn.microsoft.com/fr-fr/library/cw1sb70c (v = vs.90).aspx [ http://msdn.microsoft.com/en-us/library/kkbhxcs2 (v = vs.80).aspx [
Usually it is done by overriding the PreTranslateMessage function:

Application level:
http://msdn.microsoft.com/fr-fr/library/cw1sb70c(v=vs.90).aspx[^]

Window level:
http://msdn.microsoft.com/en-us/library/kkbhxcs2(v=vs.80).aspx[^]

However, I don''t recommand to change their value...


如果您的意思确实是键盘挂钩,而不仅仅是按键处理(如Olivier所述) ,则可以在MSDN中找到您问题的答案:
If you really mean keyboard hooks, and not just key handling (as Olivier discussed), then the answer to your question is found in MSDN:
LRESULT CALLBACK KeyboardProc(
  int code,       // hook code
  WPARAM wParam,  // virtual-key code
  LPARAM lParam   // keystroke-message information
);


非常感谢您的回复!首先,我使用WH_JOURNALRECORD的钩子类型.我知道如何使用该钩子,但是实际的问题是我需要更新lparam的值
...... LALLULT CALLBACK JournalRecordProc(int code,WPARAM wparam,LPARAM lparam);
这样我就可以在按下按键时以及将消息转发到目标窗口之前将字符从"a"更改为"A"
.
.
这可以通过使用
覆盖来完成 PreTranslateMessageEx(mesg);功能
如何覆盖以及如何更改lparam值plz解释
谢谢...
Thanks for your great replies! First of all, i''m using the hook type of WH_JOURNALRECORD . I understand how to work with the hook but the actuall problem is that i need to update the value of lparam
...... LRESULT CALLBACK JournalRecordProc(int code,WPARAM wparam,LPARAM lparam);
so that i can change character from ''a'' to ''A'' at the time of keydown and before forwarding the message to the destination window
.
.
and this can be done by overriding using
PreTranslateMessageEx(mesg); function
how to override and how to change lparam value plz explain
thankx...


这篇关于LPARAM,WPARAM查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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