如何获得新可用 Wifi 网络的通知

How to get notification for new available Wifi Network

有没有办法在检测到新 Wifi 网络时收到通知?

我浏览了本机 Wifi API 参考并找到了 WlanRegisterNotification 函数,但我不确定它是否包含我要查找的内容。备注中没有提及。

是的,WlanRegisterNotification确实是正确的函数。您需要通过查看 WLAN_NOTIFICATION_DATA (in the remarks section for WlanRegisterNotification), then WLAN_NOTIFICATION_ACM 在文档中进行一些挖掘以准确找到每个通知提供的内容。具体来说,您正在寻找这两个通知之一:

  • wlan_notification_acm_network_available 当检测到可连接的网络时发出通知,而您当前未连接到另一个网络,并且没有可用的自动连接。
  • wlan_notification_acm_scan_list_refresh (Windows 8+)

ACM代表"auto configuration module"