“You might not be familiar with messages, but they’re extremely important, especially when you need to perform tasks outside of the range of tasks that Microsoft programmed into the .NET Framework. All communication in Windows relies on messages. This article reveals Windows messages to you, shows you how to capture messages that a .NET application doesn’t normally capture, and demonstrates how to generate messages that .NET applications don’t normally generate. In short, by the time you finish this article, you’ll know about an entirely different world: the one that the .NET Framework hides from view.”
http://msdn.microsoft.com/msdnmag/issues/06/04/ManagedSpy/
Same functionality for managed code (w/o having to tap into the underlying messaging framework from code).