If you have handled this issue by petting him and saying calm down puppy, your dog was hearing, good dog keep it up. If you don't like the behavior that your dog is exhibiting at the moment, don't pet him. If he has never been corrected for this behavior before, he will only get worse. Let him know that his behavior is unacceptable to you. Make him leave the window site and calm down. This needs to be done in a firm, no nonsense, I mean business, tone.