13,824
社区成员
发帖
与我相关
我的任务
分享
void __fastcall TForm1::Button1KeyDown(TObject *Sender, WORD &Key, TShiftState Shift)
{
if(Key == VK_LEFT)
{
OutputDebugString("left");
}
else if(Key == VK_RIGHT)
{
OutputDebugString("right");
}
}
void __fastcall TForm1::ApplicationEvents1Message(tagMSG &Msg,
bool &Handled)
{
if (Msg.message == WM_KEYDOWN && Msg.hwnd == Button1->Handle)
{
if (Msg.wParam == VK_LEFT)
{
OutputDebugString("left");
}
else if (Msg.wParam == VK_RIGHT)
{
OutputDebugString("right");
}
}
}
友情提示:ApplicationEvent组件在Additional下面。