You mean your game window turns blue or you're getting a good old BSoD? If you're getting a BSoD you probably don't have a choice about shutting down ;)
This is likely a hardware problem, if you're running a newer version of Windows it might try to spit out details on the error as you log on to your computer. Otherwise you'll need to note down what the error was by hand.