VB6如何中用API拦截连接网络和断开网络的消息?

来源:百度知道 编辑:UC知道 时间:2024/09/23 11:11:55
我想在VB6中用API拦截连接网络和断开网络的Windows消息,但不知道该如何操作。我没接触过Windows消息拦截,请高手帮帮忙~最好附上源码,有追加分!
都没理解我的意思啊,我是想在网络连通时执行某一操作

我是说用回调

你可以调用IsNetworkAlive这个api函数来检查或者 实现System Event Notification Service的ISensNetwork接口。 接口那个应该在部件里面可以找的到。

IsNetworkAlive Function

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.

Syntax

Bool IsNetworkAlive(
__out LPDWORD lpdwFlags
);

Parameters
lpdwFlags
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 not valid.

Return Value
This function returns one of the following values:

Return code Description
TRUE
A local system is connected to a network.

For informa