From hotel rooms, I've used a similar approach to what this guy did:
http://www.arrl.org/news/features/2008/06/04/10144/
In this example, he is using a tuner, but that's not really necessary. You can do the same thing running an inverted vee dipole out the window. You might need two sticks, but you can probably get by with one.
Basically, have a stick poking out from the window. Run the wire out to the end of the stick, and then just flapping down into the wind. You can even have it drape down from the stick so that you can get a few more feet out there. 40 meters might be tricky from a second floor, since each wire would be 33 feet, but I bet if you were creative, you could figure out a way.