mfc 按钮快捷键

来源:互联网 发布:java游戏设计吃豆豆 编辑:程序博客网 时间:2024/05/22 00:54

类向导添加PreTranslateMessage虚函数

在函数内添加:

1某一按钮响应

if (pMsg->wParam == VK_F12 )
{
MessageBox("12");
return 1;
}

2组合按钮响应

if (pMsg->wParam == VK_F12 && (GetKeyState(VK_CONTROL)))
{
MessageBox("c+12");
return 1;
}


0 0
原创粉丝点击