• Advertisement

Archived

This topic is now archived and is closed to further replies.

Detect Internet Connection

This topic is 5383 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello out there, I need to know if my PC has an Internet connection open or not, I am using this one: function ttombform.IsConnectedToInternet: Boolean; var dwConnectionTypes: DWORD; begin dwConnectionTypes := INTERNET_CONNECTION_MODEM + INTERNET_CONNECTION_LAN + INTERNET_CONNECTION_PROXY; Result := InternetGetConnectedState(@dwConnectionTypes, 0); end; But this does not seem to work, can anybody help me out? Thanks in advance

Share this post


Link to post
Share on other sites
Advertisement
I bet the best way to check if you''re truly connected to the Internet is to try to connect to one of the most popular servers like yahoo.com, hotmail.com or similar.

Share this post


Link to post
Share on other sites
Is this a sly way of learning how to write Adware?

Sorry, can''t help you either - but I''d have guessed that the code should look like this:

function ttombform.IsConnectedToInternet: Boolean;
var
dwConnectionTypes: DWORD;
begin
dwConnectionTypes :=
INTERNET_CONNECTION_MODEM +
INTERNET_CONNECTION_LAN +
INTERNET_CONNECTION_PROXY;
Result := InternetGetConnectedState(dwConnectionTypes, 0);
end;

Note the missing "@" sign. If that doesn''t work... good luck

Share this post


Link to post
Share on other sites

  • Advertisement