我想写个软键盘的按键
进行消息转换的时候
比如有一个按向下按钮的消息
对应的两个参数这样赋值:
message = WM_KEYDOWN;
wParam = VK_DOWN;
而且还要对另一个参数 lParam = 22020097 才会有响应
那参数lParam的值怎么样才可以得到,
有没有什么公式 或 与前面的的两个的参数有个什么的对应关系可以在系统中查的
该怎么样用程序来得到呢?

解决方案 »

  1.   

    lParam
    Specifies the repeat count, scan code, extended-key flag, context code, previous key-state flag, and transition-state flag, as shown in the following table. 
    0-15
    Specifies the repeat count for the current message. The value is the number of times the keystroke is autorepeated as a result of the user holding down the key. If the keystroke is held long enough, multiple messages are sent. However, the repeat count is not cumulative.
    16-23
    Specifies the scan code. The value depends on the OEM.
    24
    Specifies whether the key is an extended key, such as the right-hand ALT and CTRL keys that appear on an enhanced 101- or 102-key keyboard. The value is 1 if it is an extended key; otherwise, it is 0.
    25-28
    Reserved; do not use.
    29
    Specifies the context code. The value is always 0 for a WM_KEYDOWN message.
    30
    Specifies the previous key state. The value is 1 if the key is down before the message is sent, or it is zero if the key is up.
    31
    Specifies the transition state. The value is always zero for a WM_KEYDOWN message.
      

  2.   

    lparam参数包含了击键的其他一些数据就是楼上说的那些东西
      

  3.   

    那就是要在程序中写每一位来得到这个参数 , 
    按上面说的就是只有16-23 要写,其它位多数情况下都是一样的.扫描码怎么得到啊??是不是就是问题中说的wParam这个参数??
      

  4.   

    http://dev.csdn.net/article/52/52263.shtm不过要模拟键盘的话,用keybd_event会比较方便