Read this tutorial. http://www.vbsquare.com/articles/subcls/

It will get you started in subclassing. Subclassing enables you to trap events for all system resources.

Also check out a product called Spyworks, at http://www.desaware.com. It really makes subclassing easy.

Let me know if you have any more questions.