Posted: 18th Mar 2014 18:31
This snippet shows how to use wininet.dll (a Windows system DLL) to check if your user's computer has an internet connection.

Note that you should NOT use it in a loop as I have done. If a connection doesn't exist, it will block your program for about 15 seconds while it times out.

+ Code Snippet
set window on
set display mode 640,480,32

load dll "wininet",1

do
cls
conn = InternetConnected()
if conn
    print "Connected"
else
    print "Not Connected"
endif

anim$ = anim$ + "."
if len(anim$) > 15 then anim$ = ""
print anim$
loop



function InternetConnected()
local ret
ret = call dll(1,"InternetCheckConnectionA","http://www.google.com",1,0)
endfunction ret
Posted: 7th Apr 2014 10:16
Useful!
Posted: 15th May 2014 13:15
Nice one.