PostMessage hwnd, WM_KEYDOWN, "A", 0
PostMessage hwnd, WM_KEYUP, "A", 0
这是可以的  当我要发送 CTRL /ALT/SHIFT 该怎么发?

解决方案 »

  1.   

    你去查MSDN,里面说的很明白
    直接查WM_KEYDOWN,WM_KEYUP这两个消息就可以。后面有详细的消息参数的说明。我记得他们是可以组合使用的。现在手边没有工具,不能具体的回答你。
      

  2.   

    查过很多了  目前位置好象没有成功的例子 谁用PSOTMESSAGE成功过啊  我用别的方法可以 但光用POSTMESSAGE是不行
      

  3.   

    nVirtKey 
    Specifies the virtual-key code of the nonsystem key. 
    lKeyData 
    Specifies the repeat count, context code, previous key-state flag, and transition-state flag, as shown in the following table. 
    0–15 Specifies the repeat count. The value is the number of times the keystroke is repeated as a result of the user holding down the key. 
    16-23 Specifies the scan code. This value depends on the original equipment manufacturer.
    29 Specifies the context code. The value is 1 if the ALT key is held down while the key is pressed; otherwise, the value is 0.
    30 Specifies the previous key state. The value is 1 if the key is down before the message is sent, or it is 0 if the key is up.
    31 Specifies the transition state. The value is 1 if the key is being released, or it is 0 if the key is being pressed.