I use an excellent if simple program called Caffeine on OS X. Its only purpose is to temporarily prevent your computer from automically sleeping, or displaying the screensaver. A similar program called Insomnia is available for Windows, but I dislike its UI.
So, I built Caffeinated. It’s a port of Caffeine that runs on Windows. The UI is straight-up lifted from Caffeine, and the entire program is pretty much just a usable wrapper around the SetThreadExecutionState function from the Windows API.