Ive been searching for a while but i cant seem to fix my problem. I want to be able to make my program detect the computer powering down. My code is always running in the background and when the computer is powering down i want it to save what its doing and then close. If anyone wants me to post my code i would be glad to do so.