I want to make an application to intercept all UI events in all the forms of my application and to write them to a log. This data can than be used to see which controls are
You should be able to achieve what you want with message filters - no direct P/Invoke to Win32-APIs required!
See the help on the IMessageFilter interface for more info.