I am having this problem with my dog Perkins. The person doesn't even have to knock on the door. If someone is walking near the house he goes OFF! It's that horrible barking you've mentioned, too. It's my biggest complaint about him because he will trample over anyone or anything in his way to get to the window and bark.
I haven't found something that works that good, yet, sadly. I will first tell him "off" as in off the couch. He listens to this maybe about 20% of the time. If he stays on the couch I calmly stand up and tell him off again, which he generally gets down then. Then I tell him to sit, and that's another hit and miss thing when he's barking. I tell him quiet when he's quiet, too. Of course I basically never have treats on me for this, so he just gets pet on for praise and told good boy.
Either way, it's something that really needs to be fixed with him because the curtains and the curtain rods in that window aren't in the best of shape thanks to his pawing at the windows while barking.
Best of luck. Hopefully we can both find something that works for us! =]