wlanscan (wlanapi)
Last changed: -182.1.99.150

.
Summary
TODO - a short description

C# Signature:

[DllImport("Wlanapi.dll",SetLastError=true)]
public static extern uint WlanScan(IntPtr hClientHandle,ref Guid pInterfaceGuid,IntPtr pDot11Ssid,IntPtr pIeData,IntPtr pReserved);

VB Signature:

<DllImport("Wlanapi.dll", SetLastError:=True)>
Public Shared Function WlanScan(ByVal hClientHandle As IntPtr, ByRef pInterfaceGuid As Guid, ByVal pDot11Ssid As IntPtr, ByVal pIeData As IntPtr, ByVal pReserved As IntPtr) As UInteger
End Function

User-Defined Types:

pDot11Ssid : Pointer to a DOT11_SSID structure.

pIeData : Pointer to a WLAN_RAW_DATA structure.

Alternative Managed API:

Do you know one? Please contribute it!

Notes:

This method just tells the interface to start doing a scan. If you want to get results as they come back, you have to register a callback function. An easier way is to call this method, wait a while, then use WlanGetAvailableNetworkList

Tips & Tricks:

Please add some!

Sample Code:

C#

      Guid g;
      //wlanHndl is the handle returned previously by calling [WlanOpenHandle]
      for (int i = 0; i < infoList.dwNumberOfItems; i++)
      {
      g = infoList.InterfaceInfo[i].InterfaceGuid;
      uint resultCode = WlanScan(wlanHndl, ref g, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero);
      if (resultCode != 0)
          return;
      }

Documentation
WlanScan on MSDN