MsgBox(0,0,_GAPI_GetIP())
; Узнать IP адресс
Func _GAPI_GetIP()
if not _GAPI_IsNetworkConnect() Then Return @IPAddress1
Local $sIP = StringRegExpReplace(BinaryToString(InetRead("http://www.whatismyip.ru")), '(?s).+\<font\scolor\=blue\>\<h1\>Ваш\sip\sадрес:\<br\>\n(\d+\.\d+\.\d+\.\d+)\n\</h1\>\</font\>.+', '\1')
Return $sIP
EndFunc
; Узнать подключение к интернету
Func _GAPI_IsNetworkConnect()
Local $aRet, $iResult = 0x0
$aRet = DllCall("sensapi.dll", "int", "IsNetworkAlive", "int*", 0)
If BitAND($aRet[1], 0x1) Then $iResult += 2
If BitAND($aRet[1], 0x2) Then $iResult += 4
If BitAND($aRet[1], 0x4) Then $iResult += 8
Return $iResult
EndFunc