无线网络控制使用Native wifi API 函数来实现
1 查找本机无线网卡
if ( WlanOpenHandle(WLAN_API_VERSION, NULL, &dwServiceVersion, &hClient) != ERROR_SUCCESS)
{wsprintf(stTemp,L"Could not return handle!");}
WlanOpenHandle(WLAN_API_VERSION, //IN 本机支持的wlan api 版本号,1=XP ,2=vista
NULL,
&dwServiceVersion, //OUT negotiated version
&hClient) //client handle
2 列出本机可用的无线网卡
WlanEnumInterfaces(hClient,NULL,
&pwLanInterfaceList) //pwLanInterfaceList->dwNumberOfItems 无线网卡的数量
WlanCloseHandle(hClient,NULL); //close handle
3 读GUID及网卡信息
WLAN_CONNECTION_PARAMETERS wLanConnPara;
memset(&wLanConnPara,0,sizeof(WLAN_CONNECTION_PARAMETERS));
pwLanInterfaceList->dwIndex=i;
wLanGUID.Data1=pwLanInterfaceList->InterfaceInfo->InterfaceGuid.Data1;
wLanGUID.Data2=pwLanInterfaceList->InterfaceInfo->InterfaceGuid.Data2;
wLanGUID.Data3=pwLanInterfaceList->InterfaceInfo->InterfaceGuid.Data3;