Well, I think you're looking for an enumeration function like this one:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms706716%28v=vs.85%29.aspx
I assume you mean to check the status of the WLan. If you look carefully, the enumeration function returns a structure that includes isState, which is one of the following:
typedef enum _WLAN_INTERFACE_STATE { wlan_interface_state_not_ready = 0, wlan_interface_state_connected = 1, wlan_interface_state_ad_hoc_network_formed = 2, wlan_interface_state_disconnecting = 3, wlan_interface_state_disconnected = 4, wlan_interface_state_associating = 5, wlan_interface_state_discovering = 6, wlan_interface_state_authenticating = 7 } WLAN_INTERFACE_STATE, *PWLAN_INTERFACE_STATE;
To actually โconnect,โ you need the server to listen on the other side ... Although Renan also gave you a good link (see the comments section), it requires that you have an SSID. It depends on whether your software really knows the Wi-Fi SSID.
source share