0

I have a MFC application. I want to statistic every button click, including button ID and time. Can I do it in CWinApp::PreTranslateMessage(MSG* pMsg) or CWnd::PreTranslateMessage(MSG* pMsg)? And how?

Andrew Truckle
  • 17,769
  • 16
  • 66
  • 164

1 Answers1

0

For your own app catching WM_CHAR should do the job, but if you are looking to catch key strokes for the entire system a hook dll, using SetWindowsHookEx, is what you need.

RonTLV
  • 2,376
  • 2
  • 24
  • 38