还有一个
SetFocus(richedit的句柄);
//将焦点设置到QQ的richedit上
{ ---------- 粘贴 ---------- }
keybd_event(VK_CONTROL, 0, 0, 0);//在Richedit发送Ctrl + V,粘贴消息
keybd_event(Byte('V'), 0, 0, 0);
//注:你记得先把发送的内容复制起来
keybd_event(Byte('V'), 0, KEYEVENTF_KEYUP, 0);
keybd_event(VK_CONTROL, 0, KEYEVENTF_KEYUP, 0);
{ ---------- 发送 ---------- }
keybd_event($11, 0, 0, 0);
//然后发送Ctrl + Enter,把消息发送出去
keybd_event($0D, 0, 0, 0);
{回车}
keybd_event($0D, 0, KEYEVENTF_KEYUP, 0);
keybd_event($11, 0, KEYEVENTF_KEYUP, 0)