It sounds like your computer is going into sleep or hibernation mode. It's a setting in power options in windows that helps save power and lets the pc do different things depending on what the power saving option is. At max savings, it will lower power to the hard drive allowing it to 'sleep', turn off the display and suspend the computer to a 'barely on' status. It "should" come back to life with a press of the keyboard or movement from the mouse but sometimes sleep states can cause issues and it doesn't function properly forcing a restart to get things working again.
The reason this program cpu 100% is preventing it is because it's not allowing the pc activity to stop so it's fooling windows into thinking it's still working. That would by my best guess of the situation.
Here is instructions on how to turn off hibernation for win7 (I'm sure there's a link for win8 there also, not sure what version you're using).
http://support.microsoft.com/kb/920730
See if that helps your situation.
* you may also have to check your bios settings, it's been awhile since I've been in my bios but if I recall there's sleep state functions there as well including a way to select what action will 'wake' the pc up from sleep. It could be that your 'wake' function is set to the power button rather than input devices (like mouse and keyboard)