Using a black brush, paint out the window frame and any other whites in the main image other than sky. Now using Select>Colour Range, select the whites on the image (on the 'select colour range' dialogue box that then appears, you have two options; Selection or Image - default is Selection! The sky area is actually black and the trees are white, which one do you mean?) and move the fuzziness slider until you've got the best match.(this bit threw me a bit...best match with what...? Moving the slider didn't seem to make any changes to anything on the image I was testing out the method on, and there was a slight colour fringeing on the leaves after Id deleted the sky from the main image...) Hit OK. Now you have an accurate mask of the skyline.
I don't have PS available at the mo, so this is from memory. Usage Image and use the eyedropper to select the white, which should be the sky and the bit you want to remove. The fuzziness slider will pick up the grey, which will be semi transparent and let you have a hard mask edge or a soft one. This is what I meant by the best match - for your image. You may need to try it a couple of times until you get the best edge for your pic. The fringing is due to having a soft edge which will 'feather' the delete on the edges of the leaves. There's no right or wrong way to do it. Each image is different. If you are doing this with an image for publication, the only way to get a really good edge is to use the pen tool, which will take a good bite out of your working day.
Post again if you need any clarification.