If you happen to be using a Thinkpad, you can take advantage of ThinkVantage Access Connection, available for Windows 7, Vista and XP.
ThinkVantage Access Connection is the network connection manager software shipped with ThinkPad - if not, downloadable from their support site. When you make a new profile for your location, there is a wizard which asks if you want to configure a list of program to start when that location is connected. It offers to kill the program when the net is out, too.
Note that the software can be configured to work without any location profile at all, and that's perhaps the initial status - in that case, there is no way to configure a list of program to start when wifi is connnected: you have to create a connection profile to contain the list.
For my own experience, I try to avoid using the software - it takes a lot more time to get connected than without it, and sometimes fails to establish new connection when booting (can be fixed by manually reconnect).
The software only works with the WIFI driver provided with the thinkpad.
On a side note, this software offers to establish connection before user logs in, as an option when you create the profile. I don't know if this is possible without it.