rajeshontheweb Posted March 30, 2009 Share Posted March 30, 2009 (edited) 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 = 0x40 Edited March 30, 2009 by rajeshontheweb Started late is much better than having never started it!!!!Failure is another step towards success. I've been messing around with: Adding Entry to 'Hosts'File Information Lister (Logger)Yet Another AutoIT Error Handler Yet Another AutoIT Error Handler & Debugger Control your App's TaskBar Button YCurrency Ticker (Latest Release : 16 Apr 2009)_WinInetInternetCheckConnection UDF Symantec Definitions Lister UDF _GetLocalIPAddresses UDF UDF to get Special Folder Information WMI_NetworkAdapterConfiguration2Array WMI_CDRomDriveCapabilities _ScriptExists - Check if your au3 script is running!! Uninstaller UDF Get Version for your application (at script level or compiled stage) Uninstaller Pro - faster alternative to windows application removal applet Link to comment Share on other sites More sharing options...
rajeshontheweb Posted March 30, 2009 Author Share Posted March 30, 2009 (edited) i know i am wrong somewhere i donno where i need to first check connection state and then will check google.com much like ping but i want to compare ping vs internetcheckconnection time taken... Allows an application to check if a connection to the Internet can be established. Parameter Information Declare Function InternetCheckConnection Lib "wininet.dll" Alias "InternetCheckConnectionA" (ByVal lpszUrl As _ String, ByVal dwFlags As Long, ByVal dwReserved As Long) As Long · lpszUrl [in"> Pointer to a string containing the URL to use to check the connection. This value can be set to NULL. · dwFlags [in] Unsigned long integer value containing the flag values. FLAG_ICC_FORCE_CONNECTION is the only flag that is currently available. If this flag is set, it forces a connection. A sockets connection is attempted in the following order. If lpszUrl is non-NULL, the host value is extracted from it and used to ping that specific host. If lpszUrl is NULL and there is an entry in WinInet's internal server database for the nearest server, the host value is extracted from the entry and used to ping that server · dwReserved [in] Reserved. Must be set to zero. Returns TRUE if a connection is made successfully, or FALSE otherwise. Use GetLastError to retrieve the error code. ERROR_NOT_CONNECTED is returned by GetLastError if a connection cannot be made or if the sockets database is unconditionally offline. Edited March 30, 2009 by rajeshontheweb Started late is much better than having never started it!!!!Failure is another step towards success. I've been messing around with: Adding Entry to 'Hosts'File Information Lister (Logger)Yet Another AutoIT Error Handler Yet Another AutoIT Error Handler & Debugger Control your App's TaskBar Button YCurrency Ticker (Latest Release : 16 Apr 2009)_WinInetInternetCheckConnection UDF Symantec Definitions Lister UDF _GetLocalIPAddresses UDF UDF to get Special Folder Information WMI_NetworkAdapterConfiguration2Array WMI_CDRomDriveCapabilities _ScriptExists - Check if your au3 script is running!! Uninstaller UDF Get Version for your application (at script level or compiled stage) Uninstaller Pro - faster alternative to windows application removal applet Link to comment Share on other sites More sharing options...
Squirrely1 Posted April 6, 2009 Share Posted April 6, 2009 i know i am wrong somewhere i donno wherei need to first check connection state and then will check google.commuch like ping but i want to compare ping vs internetcheckconnection time taken...rejeshontheweb - Try the _LocalSystem_IsInet_Connected function within _ConnectSq.au3 - look below in the signature of this post.After some research, I decided that the WinInet function it calls is the most reliable way to check for a connection brcause some workstations don't allow an out-going Ping. :pinch: Das Häschen benutzt Radar Link to comment Share on other sites More sharing options...
rajeshontheweb Posted April 18, 2009 Author Share Posted April 18, 2009 (edited) sorry for the rather delayed reply, but i was lost in another project i had taken, i am gonna use InterGetconnectedStateEx and then InternetCheckConnection, as u mentioned, i would not rather try ping coz smtp.google.com for example, doesnt always work well while pinged. so i need to get the internetcheckconnection only, probably.sorry there's been a double post, i did think it was sorted i have the code in my repository. pls get the update here. http://www.autoitscript.com/forum/index.ph...CheckConnection thanks. Edited April 18, 2009 by rajeshontheweb Started late is much better than having never started it!!!!Failure is another step towards success. I've been messing around with: Adding Entry to 'Hosts'File Information Lister (Logger)Yet Another AutoIT Error Handler Yet Another AutoIT Error Handler & Debugger Control your App's TaskBar Button YCurrency Ticker (Latest Release : 16 Apr 2009)_WinInetInternetCheckConnection UDF Symantec Definitions Lister UDF _GetLocalIPAddresses UDF UDF to get Special Folder Information WMI_NetworkAdapterConfiguration2Array WMI_CDRomDriveCapabilities _ScriptExists - Check if your au3 script is running!! Uninstaller UDF Get Version for your application (at script level or compiled stage) Uninstaller Pro - faster alternative to windows application removal applet Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now