ctrl+c PreTranslateMessage
BOOL CNewTransformDLG::PreTranslateMessage(MSG* pMsg)
{
// TODO: Add your specialized code here and/or call the base class
if (GetDlgItem(IDC_EDIT_RECORD)->m_hWnd==pMsg->hwnd)
{
if (pMsg->message==WM_KEYDOWN)
{
if (GetKeyState('c')<0||GetKeyState('C')<0)
{
if (GetKeyState(VK_CONTROL)<0)
{
// MessageBox("complement ctrl+c"); //有检测到ctrl+c的信息,但是无法复制到数据。
return CDialog::PreTranslateMessage(pMsg);
}
}
}
if (
pMsg->message ==WM_LBUTTONDOWN||
pMsg->message ==WM_LBUTTONUP||
pMsg->message ==WM_RBUTTONDOWN||
pMsg->message ==WM_RBUTTONUP||
pMsg->message ==WM_PAINT||
pMsg->message ==WM_MOUSEMOVE||
pMsg->message ==WM_COPYDATA||
pMsg->message ==WM_COPY
)
{
return CDialog::PreTranslateMessage(pMsg);
}
return TRUE;
}
return CDialog::PreTranslateMessage(pMsg);
}
有检测到ctrl+c的信息,但是无法复制到数据。请告诉帮忙分析下……
{
// TODO: Add your specialized code here and/or call the base class
if (GetDlgItem(IDC_EDIT_RECORD)->m_hWnd==pMsg->hwnd)
{
if (pMsg->message==WM_KEYDOWN)
{
if (GetKeyState('c')<0||GetKeyState('C')<0)
{
if (GetKeyState(VK_CONTROL)<0)
{
// MessageBox("complement ctrl+c"); //有检测到ctrl+c的信息,但是无法复制到数据。
return CDialog::PreTranslateMessage(pMsg);
}
}
}
if (
pMsg->message ==WM_LBUTTONDOWN||
pMsg->message ==WM_LBUTTONUP||
pMsg->message ==WM_RBUTTONDOWN||
pMsg->message ==WM_RBUTTONUP||
pMsg->message ==WM_PAINT||
pMsg->message ==WM_MOUSEMOVE||
pMsg->message ==WM_COPYDATA||
pMsg->message ==WM_COPY
)
{
return CDialog::PreTranslateMessage(pMsg);
}
return TRUE;
}
return CDialog::PreTranslateMessage(pMsg);
}
有检测到ctrl+c的信息,但是无法复制到数据。请告诉帮忙分析下……
...全文
相关推荐
FormView 视图 无法响应Ctrl+C等键盘消息解决办法 仅4行代码
FormView 视图 无法响应Ctrl+C等键盘消息解决办法 仅4行代码 无需对单个Editbox控件修改,非常好用 仅需2资源分
VC6.0中处理键盘消息
主要在vc中对键盘消息进行处理,包含有相应的消息接收,消息类型
MFC的CEdit控件
技术学习]MFC的CEdit控件中实现复制、粘贴、剪切等操作的快捷键
vc++中实现基本的剪切复制粘贴功能
这个是一个实现基本的剪切复制粘贴功能的小程序,是用MFC实现的,这个程序对于掌握对话框的使用还是非常有用的
mfc的复制剪切粘贴小程序
mfc的对话框,对EditCtrl中文字进行复制剪切粘贴。


界面
