我在Windows 7上使用Embarcaderro C++ Builder XE7。
我有几个热键在我的形式定义如下:
void __fastcall Twindow::FormKeyUp(TObject *Sender, WORD &Key, TShiftState Shift)
{
switch(Key)
{
case vkEscape:
Close();
break;
//and other cases for different keys
}
}
字符串
在某些时候,我的表单创建了一个带有问题的消息框。它工作得很好,但是当有人决定使用键盘来回答消息框时,问题就开始了。如果我按ESC关闭这个消息框,那么这个退出按钮消息肯定会关闭框,但是它也会发送到表单,表单以上面定义的方式响应(它关闭)。
我想我可能必须在发送和回复待处理的消息之前以某种方式清除它们.
我的消息框代码看起来像这样:
if(Application->MessageBoxW(L"Do you want to procees?", L"Box?", MB_OKCANCEL) == ID_OK)
{
//proceed
}
型
1条答案
按热度按时间oxosxuxt1#
这是写代码
字符串
'