Archived

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

firlefanz

Detect Internet Connection

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
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