I want to be able to make a program to "listen" to new connections that are made to and from my computer, and to be able to reject a connection made with any running program on my computer. Kind of like a firewall... but I also want to peek at the data sent/received on each connection...

I know how to use API, subclassing in VB, so please tell me even if it sounds complicated, i'm sure I'll figure it out once I get the main idea.

I'm sure there has to me some kind on API function that sends an event when a new connection is made, I just don't know witch ?