问题描述
我有一个数据卡,只要我插入数据卡,我用wm_device_change事件得到的事件。
I have a data card, as soon as i insert the data card, i am getting the events by using wm_device_change event.
但我也想获得的事件,当我的数据连接实际连接到了一方天地。
But I also want to get event, when my data connect actually connects to out side world.
我的意思是说,只要我们点击数据卡的连接/断开按钮,我想要得到的事件。
I mean to say, as soon as we click on connect/disconnect button of data card,i want to get the event.
确切地说想知道,当连接建立和断开连接。
exactly speaking wanted to know, when connection is established and disconnected.
数据卡是沃达丰数据卡,我试图使用数据卡进行浏览。什么都是SDK,某处操作系统应该得到连接和断开网络的情况下,有没有什么办法来访问事件,操作系统越来越。我可以看到在notificaiton沃达丰连接,LAN连接
data card is vodaphone data card and i am trying to browse using that data card. what ever is the SDK, somewhere the OS should get the event of connection and disconnection to network is there any way to access that event which OS is getting. as i can see in notificaiton the changes of vodaphone connection and LAN connection
数据卡是在其内具有的SIM USB设备,并且可以用于通过GPRS访问互联网。
data card is a USB device having SIM within it, and can be used to access internet through GPRS.
我可以知道如何在Win32 C / C ++ PROGRAME做到这一点。
can i know how to do this in win32 c/c++ programe.
与问候
Vinayaka Karjigi
with regardsVinayaka Karjigi
推荐答案
要检测网络的变化,则可以使用 NotifyAddrChange(0,0);
由于这是阻塞,您将需要一个线程。线程函数可以像
To detect a network change, you can use NotifyAddrChange(0,0);
Since this is blocking, you will need a thread. The thread function can be as simple as
while(true) {
NotifyAddrChange(0,0);
PostMessage(gHWnd, WM_APP,0,0);
}
不要与记录的异步行为打扰。这根本不起作用。
Don't bother with the documented asynchronous behavior. That simply doesn't work.
这篇关于如何检测数据卡连接,并在Win32断开事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!