这样发送一个键盘被按下的消息啊?(在线等,急...)
用PostMessage我想发送一个Ctrl+C被按下的消息

解决方案 »

  1.   

    ::PostMessage(hwnd, WM_WM_KEYDWOM, VK_CTRL, 0);
      

  2.   

    ::PostMessage(hwnd, WM_KEYDOWN, VK_CTRL, 0);
      

  3.   

    是Ctrl+ C 啊,不是单Ctrl
      

  4.   

    先发 Ctrl WM_KEYDOWN, 再发 C  WM_KEYDOWN, 再发 C WM_KEYUP, 再发Ctrl WM_KEYUP
      

  5.   

    D:\我的文档\编程文档\paste\HtmlCtrl.cpp(149) : error C2065: 'VK_V' : undeclared identifier
      

  6.   

    shadowac(走向黑暗) 的思路对的,但是VK_V不存在?
      

  7.   

    ::PostMessage(hwnd, WM_KEYDOWN, VK_CTRL, 0);
    ::PostMessage(hwnd, WM_KEYDOWN, 'C', 0);
    ::PostMessage(hwnd, WM_KEYUP, 'C', 0);
    ::PostMessage(hwnd, WM_KEYUP, VK_CTRL, 0);
      

  8.   

    想往一个edit框里发送Ctrl+V 消息以粘贴剪贴版里的东西,但是只会输入两个V,怎么办啊
      

  9.   

    还有,CEdit类本身已经有几个剪贴板操作了
      

  10.   

    ::PostMessage(hwnd, WM_KEYDOWN, VK_CTRL, 0);
    ::PostMessage(hwnd, WM_KEYDOWN, 'C', 0);
    ::PostMessage(hwnd, WM_KEYUP, 'C', 0);
    ::PostMessage(hwnd, WM_KEYUP, VK_CTRL, 0);
      

  11.   

    别发按键消息了,直接用 CEdit::Paste()
    或者发送WM_PASTE消息,这个消息不需要输入参数
      

  12.   

    不是啊,其实那不是一个CEDIT的对象,如果要用的话得调用com的,我想偷个懒
      

  13.   

    WM_KEYDOWN的lParam参数怎么设置?
    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.
      

  14.   

    不是的,其实它本身是一个html控件,里面有网页,我不想用com,所以就...