Can anybody point me to an example of how to do this with Visual Basic code?

The best API book I have is Dan Appleman's Guide for VB5.0, and he doesn't even touch the subject of system hooks. There are some really powerful programming techniques to be mined here if some guru would be kind enough to throw up some example code in VB.