Normally when I want to change the connection for a Query Editor Window in SQL Server Management Studio, I can select a new connection from the menus at the top - Query > Co
Luckily in SSMS 2008-R2, 2012 There is a change connection function. Placed just before the DB dropdown.
Or via menu Query>Connection>Change Connection.