| View previous topic :: View next topic |
| Author |
Message |
Sandra Guest
|
Posted: Mon Jan 15, 2007 6:10 am Post subject: detecting internet status |
|
|
Hi , can AHK script detect if generally Windows has a running Internet or is offline? How would you express that in AHK script language? I am working on a stage where it looks to see if internet is there or not in my scripting, so I am at a impass...figuring this call out I hope you see my picture and phase... pls. help!!  |
|
| Back to top |
|
 |
BoBo Guest
|
Posted: Mon Jan 15, 2007 9:07 am Post subject: |
|
|
| Quote: | | How would you express that in AHK script language? |
| Code: | | Run, iexplore,, max |
|
|
| Back to top |
|
 |
AngieX
Joined: 26 Nov 2006 Posts: 77
|
Posted: Mon Jan 15, 2007 10:33 am Post subject: Sandra |
|
|
| BoBo wrote: | | Quote: | | How would you express that in AHK script language? |
| Code: | | Run, iexplore,, max |
|
Say what ?!  |
|
| Back to top |
|
 |
BoBo Guest
|
Posted: Mon Jan 15, 2007 10:53 am Post subject: |
|
|
If the browser starts correctly with the preset template/home, you're online.  |
|
| Back to top |
|
 |
AngieX
Joined: 26 Nov 2006 Posts: 77
|
Posted: Mon Jan 15, 2007 10:59 am Post subject: |
|
|
| BoBo wrote: | If the browser starts correctly with the preset template/home, you're online.  |
Ah I see where you are going. It certainly validates the Internet 'home page' shows you're on the Internet, but I am hoping some way is possible with AHK to return a variable 1=on 2=off approach - can be done  |
|
| Back to top |
|
 |
tonne
Joined: 06 Jun 2006 Posts: 1158 Location: Denmark
|
Posted: Mon Jan 15, 2007 11:08 am Post subject: |
|
|
| Quote: | IsNetworkAlive
The IsNetworkAlive function determines whether or not a local system is connected to a network, and identifies the type of network connection, for example, a LAN, WAN, or both.
Bool IsNetworkAlive(
LPDWORD lpdwFlags
);
Parameters
lpdwFlags
[out] The type of network connection that is available. This parameter can be one of the following values:
NETWORK_ALIVE_LAN
The computer has one or more LAN cards that are active.
NETWORK_ALIVE_WAN
The computer has one or more active RAS connections.
NETWORK_ALIVE_AOL
This flag is only valid in Windows Me/98/95.
Indicates a computer is connected to the America Online (AOL) network.
Return Values
This function returns one of the following values:Return code Description
TRUE A local system is connected to a network.
For information about the type of connection, see the lpdwFlags parameter.
FALSE There is no connection.
For extended error information, call GetLastError.
Remarks
This function can be used by an application to determine whether or not there is network connectivity before proceeding with network operations. A directory service type of application, e-mail client, or Internet browser can adapt to various types of network connectivity. For example, a printing operation can be deferred until a network connection is available.
It may not always be practical for an application to call IsNetworkAlive to determine whether or not a local system is disconnected from a LAN, because IsNetworkAlive can be slow, and it may take too much time for the function to detect that a local system is disconnected. However, IsNetworkAlive can always identify a WAN connectivity at the moment.
Note This function is only available for TCP/IP connections.
|
Resides in sensapi.dll _________________ there's a dog barking close within the range of my ear
sounds like he wants to escape the chain
he would probably bite me to death if he could
but the chain lets me spit in his face
- Kashmir |
|
| Back to top |
|
 |
ZeLen1y
Joined: 11 Oct 2006 Posts: 4
|
Posted: Tue Jan 16, 2007 2:59 am Post subject: |
|
|
| Code: | | MsgBox, % DllCall("sensapi.dll\IsNetworkAlive", "UInt *", "NETWORK_ALIVE_LAN") |
|
|
| Back to top |
|
 |
Seabiscuit
Joined: 07 Jan 2007 Posts: 109 Location: In fund pe scaun, la o bere prin Romania :D
|
|
| Back to top |
|
 |
POINTS
Joined: 18 Jan 2006 Posts: 283
|
Posted: Sat Sep 22, 2007 11:40 pm Post subject: I have a script |
|
|
I have a script that runs when I start my computer because sometimes it takes a minute or 2 to get an IP address. This script shows a splash screen until the computer has an IP. (It might not work on all machines.) The script assumes that we have an IP address that doesn't start with 192.168. until we get a valid one that does.
| Code: |
; Check to see if we have an IP address yet
if (InStr(A_IPAddress1, "192.168." ) != 1) ; if it is not the first position
{
SplashTextOn,,, Resolving IP Address...
Loop
{
if (InStr(A_IPAddress1, "192.168." ) == 1) ; if it is the first position
break
Sleep 100
}
SplashTextOff
}
Return |
_________________ My AutoHotkey Program for Warcraft III:
Warkeys
http://warkeys.sourceforge.net/
Remap your hotkeys
Healthbars always on
Remap inventory |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 5811
|
Posted: Sun Sep 23, 2007 8:50 am Post subject: |
|
|
| Seabiscuit wrote: | The code above doesnt works for me.
I have Internet through lan-usb, could be this the problem? |
You may try the couple of methods posted here
 |
|
| Back to top |
|
 |
|