I think there will be a separate authentication stage, which is where the SSID etc. come into play. This will be very much OS-specific.
And this is what I am after
I was trying to emphasise that APs are, generally speaking, much more than ' just a "wide range" Antenna', and that they can't be relied on to be controllable with the standard "Berkeley-like" sockets API.
Anyway, as a forum user I'm glad to see that a couple of people have contributed focussed answers: I didn't mention wpa_supplicant myself since I think you hinted that you were interested in Windows, although I suppose it might have been relevant since it indicated the range of parameters applicable.
But I still feel that broadly speaking it's not something that an app would get involved with. Even the sort of stuff which I write, but gets pretty weird on occasion.
MarkMLl