Subclassing is what you're looking for. Subclassing is the act of intercepting the messages that the Windows operating system send to every object(window, control, etc.) that is currently active.

You can intercept messages for the whole system, or just one object.

Desaware has some excellent controls that make subclassing easy. Go to http://www.desaware.com/SpyWorksL2.htm and look at their Spyworks product.