I want to log all clicks in a MainMenu control I am using in a C# WinForms application. The menu system in place is very extensive and some of it is generated on the fly. I am looking for a way to add something directly to MainMenu that will get me the MenuItem object when it is clicked.
I have used Application.AddMessageFilter to catch all clicks in the rest of the application but it seems that the MainMenu control somehow gets around being tracked in this way.
If you need something that is global, have a look at http://globalmousekeyhook.codeplex.com/
I’m not sure if I would do this in my applications, they certainly wouldn’t pass ‘clean’ software tests by auditors but perhaps your application is company internal and capturing this ‘particular/single’ applications keystrokes and mouse movements would satisfy security requirements.