void __fastcall TForm1::btn4Click(TObject *Sender)
{
    /* 模拟CTRL + + 符号消息 */
    redt1->SetFocus();
    keybd_event(VK_CONTROL,0,0,0);
    keybd_event(187,0,0,0);
    keybd_event(187,0,KEYEVENTF_KEYUP,0);
    keybd_event(VK_CONTROL,0,KEYEVENTF_KEYUP,0);

}
//---------------------------------------------------------------------------
void __fastcall TForm1::redt1KeyDown(TObject *Sender, WORD &Key,
      TShiftState Shift)
{
    mmo1->Lines->Add(IntToStr(Key));
}
//---------------------------------------------------------------------------
void __fastcall TForm1::btn6Click(TObject *Sender)
{
    /* 模拟 CTRL + SHIFT + + 符号消息 */
    redt1->SetFocus();
    keybd_event(VK_CONTROL,0,0,0);
    keybd_event(VK_SHIFT,0,0,0);
    keybd_event(187,0,0,0);
    keybd_event(187,0,KEYEVENTF_KEYUP,0);
    keybd_event(VK_SHIFT,0,KEYEVENTF_KEYUP,0);
    keybd_event(VK_CONTROL,0,KEYEVENTF_KEYUP,0);
}

 

posted on 2021-04-20 15:35  zooz  阅读(301)  评论(0编辑  收藏  举报