Take a look at:
http://en.wikipedia.org/wiki/Winsock
http://en.wikipedia.org/wiki/Transmission_Control_Protocol
http://msdn.microsoft.com/en-us/library/ms738545(VS.85).aspx
You can use an existing library like Winpcap (http://www.winpcap.org/),
or API's like LSP (http://en.wikipedia.org/wiki/Layered_Service_Provider) /
NDIS...
The link doesn't work so I don't know what your initial request was.
I can only assume that you would like to intercept and manipulate packets, and if that's the case why hook if you...
After you create an instance of CInternetSession, call CInternetSession::GetHttpConnection() to establish HTTP connection and get a pointer to a CHttpConnection object that can manage the connection...
GetLastError() return the calling thread's last-error code.
Error codes are 32-bit values so to display the error code you will have to construct a string representation of the error code, something...