Programming Tips - MFC: How can I manually add a timer message handler to my MFC code?

Date: 2015oct23 OS: Windows Framework: MFC Language: C/C++ Q. MFC: How can I manually add a timer message handler to my MFC code? A. In the .h file add:
class CMyDialogDlg : public CDialog { ... afx_msg void OnTimer(UINT nIDEvent); ... }
In the .cpp file add:
BEGIN_MESSAGE_MAP(CMyDialogDlg, CDialog) ... ON_WM_TIMER() ... END_MESSAGE_MAP() ... void CMyDialog::OnTimer(UINT id) { // ... Do what you want here... CDialog::OnTimer(id); }