Здравствуйте Сергей, Вы писали:
С>Люди, есть класс производный от CEdit. Не могу поймать в нем WM_PASTE.
С>С>BOOL MyEdit::PreTranslateMessage(MSG* pMsg)
С>{
С> // TODO: Add your specialized code here and/or call the base class
С> if(pMsg->message == WM_PASTE)
С> AfxMessageBox("PreTranslate");
С> .........................
С>}
С>
С>молчит как рыба. В чём мой баг?
WM_PASTE посылается прямиком, не через очередь сообщений.
Придется добавить руками:
// MyEdit.h
. . .
protected:
//{{AFX_MSG(CMyEdit)
// NOTE - the ClassWizard will add and remove member functions here.
//}}AFX_MSG
afx_msg LRESULT OnPaste(WPARAM wParam, LPARAM lParam); // !!!
DECLARE_MESSAGE_MAP()
}
// MyEdit.cpp
. . .
BEGIN_MESSAGE_MAP(CMyEdit, CEdit)
//{{AFX_MSG_MAP(CMyEdit)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_MSG_MAP
ON_MESSAGE( WM_PASTE, OnPaste ) // !!!
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMyEdit message handlers
LRESULT CMyEdit::OnPaste(WPARAM /*wParam*/, LPARAM /*lParam*/) // !!!
{
MessageBox( _T("Paste") );
return 0;
}