Another suggestion, this work for my boy. When you see a news about baby/pet accidents with photos, cut it down and show it to your children. Describe how naughty they are, with all the arms and legs got hurt, and need to lie on the bed for a month without any movement. Then ask him whether he want to be like that. Then keep this news on file. Next time when he get close to the window, u remind him whether he want to see that picture again? My son will immediately keep away to the window, and said he doesn't want to see that picture again.