Jump to content

DllCall - InternetCheckConnection (InternetGetConnectedState works)


Recommended Posts

BOOL InternetCheckConnection(
  LPCTSTR lpszUrl,
  DWORD dwFlags,
  DWORD dwReserved
);

is represented as

$ret = DllCall("WinInet.dll","int","InternetGetConnectedState","int_ptr",0,"int",0)

$ret[0] = 1 if connected 

$ret[1] possibly one of these or blank 

$INTERNET_CONNECTION_MODEM          = 0x1
$INTERNET_CONNECTION_LAN            = 0x2
$INTERNET_CONNECTION_PROXY          = 0x4
$INTERNET_CONNECTION_MODEM_BUSY     = 0x8
$INTERNET_RAS_INSTALLED             = 0x10
$INTERNET_CONNECTION_OFFLINE        = 0x20
$INTERNET_CONNECTION_CONFIGURED     = 0x40oÝ÷ Ø,íz¹Þ´g­
çyË^u+Zµê.´³ÃXäCpV ²)ÃXäCw^±êïyÛaÇhzÉí­ën®{ayÊ+­ç-½©nyú+殶­sg&WCÒFÆÄ6ÆÂgV÷CµväæWBæFÆÂgV÷C²ÂgV÷C¶çBgV÷C²ÂgV÷C´çFW&æWD6V6´6öææV7FöâgV÷C²ÂgV÷C·7G"gV÷C²ÂgV÷C¶GG¢ò÷wwrævöövÆRæ6öÒgV÷C²ÂgV÷C¶Æöæu÷G"gV÷C²ÃÂgV÷C¶Æöæu÷G"gV÷C²Ã ¦vfW0¢§&WE³ÒÒ²6÷VÆB&WGW&âbFÆÂv26ÆÆVB6÷'&V7FÇóóð§&WC³ÒÒgV÷C¶GG¢ò÷wwrævöövÆRæ6öÒgV÷C°
Link to comment
Share on other sites

  • Moderators

Hard to return the proper values when you don't use the proper ones in the first place (or you don't make your variables actually autoit variables with the dollar sign in front of the var name).

Local $sz_url = "http://www.google.com"
Local $u_flags = 0x00000001
Local $u_reserved = 0
Local $a_ret_val = DllCall("WinInet.dll", "int", "InternetCheckConnection", "str", $sz_url, "uint", $u_flags, "uint", $u_reserved)
ConsoleWrite($sz_url & " is connected = " & ($a_ret_val[0] <> 0) & @CRLF)

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...