How to go about implementing a user activity logger in MFC application.To get to know what are all the features are used most in an existing application.
A:
You can override the windows procedure of your application window:
class CMyMainWindow {
void LogUsageData(UINT message);
virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam) {
LogData(message);
return CWnd::WindowProc(message, wParam, lParam); // route message to message map
}
}
Note that the task is not so trivial: LogUsageData
should discard most messages, focusing only on the ones defined in the message map.
However, this should be a good place to start.
Roberto Liffredo
2009-07-09 20:59:45