Did you make this instructable?

I had a similar problem with a shiny kitchen appliance but dog training is definitely the way to go because with zappers etc. anyone who touches will also get zapped unless you are going to be in the room 24/7. Basically the training involves distracting the dog as soon as it approaches (not reaches) the window with a sharp hard clap or a AKK-AKK sound. If it stops you praise it and make a fuss, if not you remove the dog out of the room (which is where it wants to be) immediately. No raised voices, smacks etc. will work but dogs learn very fast and want to please you, the boss (alpha dog). Calm repeating of the SAME behaviour will get great results. Why not spend the amount you are prepared to spend on zapping on a trainer . You wont regret it. Good luck with this

Have you tried the non-tech ways like training your dog, wiping the glass down with some yucky stuff dogs don't like their nose rubbed in first? Putting down some marker or deterrent strip on the ground that they know not to walk past or window screens? Otherwise look up designs for proximity sensors or figure out how electric cow fences work.