如何在PreTranslateMessage(MSG* pMsg) 截获Ctrl+X组合键? BOOL GetKeyboardState( PBYTE lpKeyState // array of status data); 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 试试以下代码(可能有些细节尚须处理):BOOL CSampleDlg::PreTranslateMessage(MSG* pMsg) { // TODO: Add your specialized code here and/or call the base class if(pMsg->message ==WM_KEYDOWN && pMsg->wParam ==VK_CONTROL) ctrl=true; if(ctrl && pMsg->message ==WM_KEYDOWN && pMsg->wParam == 'C') { MessageBox("dfff"); ctrl=false; } if(pMsg->message ==WM_KEYUP && pMsg->wParam ==VK_CONTROL) ctrl=false; return CDialog::PreTranslateMessage(pMsg);} 为什么if(pMsg->message ==WM_KEYUP && pMsg->wParam ==VK_CONTROL)会ctrl=false; if(pMsg->hwnd == Object.GetSafeHwnd() && pMsg->message == WM_KEYDOWN && pMsg->wParam==VK_C&& (GetKeyState(VK_CONTROL)&0x8000)) { AfxMessageBox("截到了Ctrl+C键"); } ctrl是自己加类的成员变量,初始化为false 求教一个关于ADO的问题 TCP WSAAsyncSelect模型正在传输数据,怎样终止它? 在vbscript或者javascript中如何获得COM里safearray的数据 初学者求教,请大家帮忙,谢谢! 如何判断一个程序/进程已经死了? 怎么获得对话框窗口的大小 急 怎么得到网络的状态? 菜鸟求助!用VC解决俄罗斯方块问题!帮帮忙!谢谢... 怎样把char *类型转换成LPCTSTR 或CString类型? 有c的问题? 如何使vc程序脱离vc环境独立运行? 谁有做过bo2k的源代码分析..能不能给我一份心得..
{
// TODO: Add your specialized code here and/or call the base class
if(pMsg->message ==WM_KEYDOWN && pMsg->wParam ==VK_CONTROL)
ctrl=true;
if(ctrl && pMsg->message ==WM_KEYDOWN && pMsg->wParam == 'C')
{
MessageBox("dfff");
ctrl=false;
}
if(pMsg->message ==WM_KEYUP && pMsg->wParam ==VK_CONTROL)
ctrl=false;
return CDialog::PreTranslateMessage(pMsg);
}
会ctrl=false;
pMsg->message == WM_KEYDOWN &&
pMsg->wParam==VK_C&& (GetKeyState(VK_CONTROL)&0x8000))
{
AfxMessageBox("截到了Ctrl+C键");
}