Platform SDK: Synchronization Manager

IsNetworkAlive

Determines whether the local system is connected to a network and the type of network connection, for example, LAN, WAN, or both.

Bool IsNetworkAlive(
  LPDWORD lpdwFlags     // Specifies the type of network connection
);

Parameters

lpdwFlags
Provides information on the type of network connection available when the return value is TRUE. The flags can be:
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 95 and Windows 98. Indicates the computer is connected to the America Online network.

Return Values

TRUE
The local system is connected to a network.
FALSE
Call GetLastError to determine the reason for no connectivity.

Remarks

This function can be used by applications to determine whether there is network connectivity before proceeding with network operations. Applications such as directory service applications, e-mail clients, or Internet browsers can adapt to various types of network connectivity. For example, a printing operation can be deferred until the network connection is available.

Note  This function is only available for TCP/IP connections.

Requirements

  Windows NT/2000: Requires Windows 2000 (or Windows NT 4.0 with Internet Explorer 5 or later).
  Windows 95/98: Requires Windows 95 or later (with Internet Explorer 5 or later).
  Header: Declared in Sensapi.h.
  Library: Use Sensapi.lib.
  Unicode: Implemented as Unicode and ANSI versions on Windows NT/2000.

See Also

IsDestinationReachable, About System Event Notification Service