dcsimg
Results 1 to 9 of 9

Thread: VB6 - Wireless Network API Exposed

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jul 2006
    Location
    Maldon, Essex. UK
    Posts
    6,334

    VB6 - Wireless Network API Exposed

    I've been doing some work with the WLAN API and thought that some may be interested. It's not complete yet but there's enough to get anyone interested in 'playing' a reasonable start.

    The attached is a small project which will display the attributes of all available Wireless Networks to the Immediate Window and populate a ComboBox with the Available Networks Profile Names. Click on 'Show Wireless Networks' to start.

    Clicking on a Profile Name will disconnect from the current network and attempt to connect to that network (Note that I have only tested this part on an unsecured network - feedback on other types of networks would be appreciated). Clicking on the 'Disconnect' button will disconnect from the currently connected network.

    The WLAN_NOTIFICATION_CALLBACK routine is used to show the various stages involved in Connection and Disconnection, which are also displayed to the Immediate Window.

    A word of warning, when running from the IDE make sure you exit via the 'Exit' button. This ensures that the Notification process is terminated in a proper fashion. If you don't do that, then you'll find that the IDE crashes within 1 minute.

    Microsoft Documentation is here: http://msdn.microsoft.com/en-us/libr...(v=VS.85).aspx

    This is only applicable to XP SP2 and above (XP SP2 users can download the API from here: http://www.microsoft.com/downloads/e...displaylang=en)

    Feedback appreciated
    Attached Files Attached Files
    Last edited by Doogle; Nov 16th, 2010 at 07:45 PM.

  2. #2
    Hyperactive Member
    Join Date
    Jul 2009
    Posts
    489

    Re: VB6 - Wireless Network API Exposed

    i need this, and hope to make something usefull of it
    i'll test it, and report sometime later
    thanks.

  3. #3
    Hyperactive Member
    Join Date
    Jul 2009
    Posts
    489

    Re: VB6 - Wireless Network API Exposed

    i just tried it on vista and got a crash.
    i run it outside the ide, (i don't have vb6 on vista)
    the crash was from the vb6vm.dll (something like this)

    but thank you anyway, i can test this with the sdk link you gave

  4. #4
    Fanatic Member coolcurrent4u's Avatar
    Join Date
    Apr 2008
    Location
    *****
    Posts
    990

    Re: VB6 - Wireless Network API Exposed

    hello, do you have any code for bluetooth, or will this one work
    Programming is all about good logic. Spend more time here


    (Generate pronounceable password) (Generate random number c#) (Filter array with another array)

  5. #5

    Thread Starter
    PowerPoster
    Join Date
    Jul 2006
    Location
    Maldon, Essex. UK
    Posts
    6,334

    Re: VB6 - Wireless Network API Exposed

    I don't have any Bluetooth capability so haven't played with it. There is a Bluetooth API set. Details here: http://msdn.microsoft.com/en-us/library/ms834669.aspx

  6. #6
    Fanatic Member coolcurrent4u's Avatar
    Join Date
    Apr 2008
    Location
    *****
    Posts
    990

    Re: VB6 - Wireless Network API Exposed

    it lloks as if there is no support for bluetooth api for windows generally, but Windows CE. I heard that bluetooth device can be used by using mscomm, but don't know the specific command on how to use it
    Programming is all about good logic. Spend more time here


    (Generate pronounceable password) (Generate random number c#) (Filter array with another array)

  7. #7
    Junior Member
    Join Date
    Apr 2019
    Posts
    27

    Re: VB6 - Wireless Network API Exposed

    Hi,

    I had a question but I have found a solution. Instead of deleting the post, I will post the code, somebody could find it useful:


    In the declaration section of Doogle code:

    Code:
    Private Type WLAN_BSS_ENTRY
    
        dot11Ssid As DOT11_SSID
        phyId As Long
        dot11Bssid(5) As Byte
        dot11BssType As DOT11_BSS_TYPE
        dot11BssPhyType As DOT11_PHY_TYPE
        rssi As Long
        LinkQuality As Long
        inRegDomain As Boolean
        BeaconPeriod As Long
        timestamp As Currency
        hostTimestamp As Currency
        CapabilityInformation As Long
        chCenterFrequency As Long
        WlanRateSet As Long
        ieOffset As Long
        ieSize As Long
    
    End Type
    
    Private Declare Function WlanGetNetworkBssList _
                    Lib "wlanapi.dll" (ByVal hClientHandle As Long, _
                                       pInterfaceGui As GUID, _
                                       ByVal pDot11Ssid As Long, _
                                       ByVal dot11BssType As Long, _
                                       ByVal bSecurityEnabled As Long, _
                                       ByVal pReserved As Long, _
                                       ppWlanBssList As Long) As Long
    And this is when enumerating networks:

    Code:
     
    Dim lBSS As Long
    lngReturn = WlanGetNetworkBssList(lngHandle, udtList.InterfaceInfo.ifGuid, 0&, DOT11_BSS_TYPE.DOT11_BSS_TYPE_ANY, False, 0&, lBSS)
    CopyMemory udtBSS, ByVal lBSS, LenB(udtBSS)
    This is how can get additional wireless network information, like channel, transfer rates, rssi, and etc. More info @Microsoft

    Thanks.
    Last edited by npac4o; Dec 15th, 2019 at 09:13 PM.

  8. #8
    Fanatic Member
    Join Date
    Dec 2012
    Posts
    810

    Re: VB6 - Wireless Network API Exposed

    With a little rearranging I got this program to work. Does anyone know why it does not show 5.0 GHz networks?

    J.A. Coutts

  9. #9
    Fanatic Member
    Join Date
    Dec 2012
    Posts
    810

    Re: VB6 - Wireless Network API Exposed

    Quote Originally Posted by couttsj View Post
    With a little rearranging I got this program to work. Does anyone know why it does not show 5.0 GHz networks?

    J.A. Coutts
    It appears to be related to either the Adapter or the OS, as a Win 10 machine showed the 5.0 GHz networks before it crashed. When I checked the Network availability provided by MS on the Win 8.1 machine, the 5.0 GHz also did not show up.

    J.A. Coutts

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width