Jump to content
  • Advertisement

Archived

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

firlefanz

Detect Internet Connection

This topic is 5472 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
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!