Люди, есть класс производный от 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");
.........................
}
молчит как рыба. В чём мой баг?
Здравствуйте Сергей, Вы писали:
С>Люди, есть класс производный от CEdit. Не могу поймать в нем WM_PASTE.
С>молчит как рыба. В чём мой баг?
По моему не в чем.
Создал стандартный диалог.
WM_PASTE не ловиться
Следовательно не будет ловиться и в CEdit.
Здравствуйте Сергей, Вы писали:
С>Люди, есть класс производный от 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;
}
Здравствуйте Игорь Вартанов, Вы писали:
ИВ>Здравствуйте Сергей, Вы писали:
С>>Люди, есть класс производный от 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;
ИВ>}
ИВ>
Да, я его так поймаю, но как мне его потом дальше пропустить?
Здравствуйте Сергей, Вы писали:
С>Да, я его так поймаю, но как мне его потом дальше пропустить?
return DefWindowProc(WM_PASTE, wParam, lParam);