Hi kf10,
What you described happens when your system hangs & you don't terminate the offending program(s) via task manager & properly shut down your computer. Windows follows a sequence of closing applications and system functions when you click shutdown, restart, or use any of the below listed processes short of the last resort (power button).
Without getting technical, what happens, essentially, is that those programs you had running when the system hung, were not properly terminated, and windows thinks they are still running, which they were when you pressed the power button. On restart, Windows boots & starts/runs the programs that were open.
Here's the:
Proper order of steps to restart or shut down a locked-up Windows 7 computer
1. Press Esc twice; this action rarely works but give it a shot anyway.
2. Press Ctrl+Alt+Delete simultaneously and choose Start Task Manager. If you’re lucky, the Task Manager appears with the message that you discovered an unresponsive application. The Task Manager lists the names of currently running programs, including the one that’s not responding. Click the name of the program on the Application tab that’s causing the mess and then click the End Task button.
3. If that still doesn’t do the trick, press Ctrl+Alt+Delete again and look for the little red button in the bottom-right corner of the screen. Click the little arrow next to that button’s circle. Choose Shut Down from the menu that pops up.
4. If the preceding approaches don’t work, push the computer’s reset button. If the Turn Off Computer box appears, choose Restart.
5. Last and most undesirable options: If not even the reset button works (and some computers don’t even have reset buttons anymore), turn the computer off by pushing its power button. (If that merely brings up the Turn Off the Computer menu, choose Restart, and your computer should restart.) If you hold in the computer’s power button long enough (usually about 4 to 5 seconds), the PC will eventually stop resisting and turn off.