BOOL CChildView::PreTranslateMessage(MSG* pMsg)
{
if (pMsg->hwnd == GetDlgItem(IDC_EDIT_1)->GetSafeHwnd())
{
if (pMsg->message == WM_KEYDOWN)
{
if (pMsg->wParam == VK_ESCAPE)
{
}
else if (pMsg->wParam == VK_RETURN)
{
}
else if (pMsg->wParam == VK_TAB)
{
}
}
BOOL bShift = ((GetKeyState(VK_SHIFT) & 0x8000) != 0); // Shift 키가 눌렸는지의 여부 저장
BOOL bControl = ((GetKeyState(VK_CONTROL) & 0x8000) != 0); // Control 키가 눌렸는지의 여부 저장
BOOL bAlt = ((GetKeyState(VK_MENU) & 0x8000) != 0);
if (bControl && !bShift && !bAlt) --> ctrl 키만을 걸러냄..
{
if(pMsg->wParam == 'v' || pMsg->wParam == 'V')
{
// Paste 함수 구현
}
if(pMsg->wParam == 'c' || pMsg->wParam == 'C')
{
// Copy 함수 구현...
}
}
return CWnd::PreTranslateMessage(pMsg);
}
'MFC' 카테고리의 다른 글
CListCtrl 클립보드 복사 (0) | 2013.11.26 |
---|---|
CListCtrl (0) | 2013.11.26 |
PreTranslateMessage (0) | 2013.11.22 |
GetBorderSize (0) | 2013.11.18 |
단일 문서에 뷰 여러 개 추가 (0) | 2013.11.15 |