I have a problem. My application wants to check wether there is an internet connection and if the system is online at the moment. The function above returns every time 1 in eax. In the buffer (one parameter has to be zero, another is a pointer to an interger buffer) i get 12h as long as im not connected. There are these possible values:

INTERNET_CONNECTION_CONFIGURED
Local system has a valid connection to the Internet, but it might or might not be currently connected.
INTERNET_CONNECTION_LAN
Local system uses a local area network to connect to the Internet.
INTERNET_CONNECTION_MODEM
Local system uses a modem to connect to the Internet.
INTERNET_CONNECTION_MODEM_BUSY
No longer used.
INTERNET_CONNECTION_OFFLINE
Local system is in offline mode.
INTERNET_CONNECTION_PROXY
Local system uses a proxy server to connect to the Internet.
INTERNET_RAS_INSTALLED
Local system has RAS installed.

My problem is, i dont find these eqates in the wininet.h (the function is exported by wininet.dll) . Can anybody give me those equates?

Thanx
Posted on 2002-01-07 10:30:39 by belial
INTERNET_CONNECTION_MODEM equ 1
INTERNET_CONNECTION_LAN equ 2
INTERNET_CONNECTION_PROXY equ 4
INTERNET_RAS_INSTALLED equ 10h
INTERNET_CONNECTION_OFFLINE equ 20h
INTERNET_CONNECTION_CONFIGURED equ 40h
Posted on 2002-01-07 10:37:35 by japheth
My application wants to check wether there is an internet connection and if the system is online at the moment.

Just be aware that this function will not show if you are actually currently connected to the internet. To check that, you will have to ping or try to GET an index page from one or two major sites. When you do so, make sure in your headers that you specify to get the page from the website, so that you don't get the copy that is possibly stored in the cache. Also, when you try to test the connection, be aware of possible firewall and proxy problems.
Posted on 2002-01-07 15:28:23 by sluggy
Well it does show if you are actually currently connected to the internet if you are using a dial-up. Otherwise you will most probably have to go Sluggy's route. A good resource for APIs, equates, etc, its made for VB but easily translatable, is www.allapi.net.
Posted on 2002-01-07 15:36:24 by peterverstappen
its made for VB but easily translatable, is www.allapi.net.

Also, that site and some of the ones it links to also have excellent code covering this exact problem, like peter. said it is easily translated.
Posted on 2002-01-07 15:56:39 by sluggy
Maybe you sould use RasEnumConnections and RasGetConnectStatus. If u want that your program receives control when a connection is created or closed (when u start dialoging) u should use an event object that is used with RasConnectionNotification.

bye

Coder7345/Jean
Posted on 2002-01-08 10:17:15 by coder