The following combination works for me on Windows 7 and Windows XP SP3:
InternetCheckConnection("http://www.google.com", FLAG_ICC_FORCE_CONNECTION, 0) ;
GetLastError () returns 0 if communication is possible and returns 12029 (an attempt to connect to the server failed), if not.
The following combinations do not work for me:
InternetCheckConnection(NULL, FLAG_ICC_FORCE_CONNECTION, 0) ;
GetLastError () returns 12016 (the requested operation is not valid).
InternetCheckConnection(NULL, 0, 0) ;
InternetCheckConnection(("http://www.google.com", 0, 0) ;
GetLastError() 2250 ( ).