A black screen may not be an indication of an operating system problem, but it is a common indicator of a hardware problem. Only if you can be sure the problem is not hardware-related would I move on to a software problem. The error message you see when starting your computer is the same message you'd see if you just held the power button down while the computer was running normally. Windows complains when it isn't shut down correctly.
The LCD backlight or inverter in your laptop screen may be to blame. The next time this happens, get a powerful flashlight and shine it on the laptop display. If you can see the contents of the screen, then it's just the backlight or inverter that has failed. Contact HP for a replacement. If, when the screen goes black, you press the Caps Lock button and the LED still flashes, and pressing the CD eject button still ejects the tray, this is very likely the problem. You could also try connecting your laptop to an external monitor (make sure it's working before the screen goes black).
If your system is typically connected by AC power, remove the battery and see if the problems persist. An aged or damaged battery can send incorrect messages to the computer that cause it to shut down unexpectedly.
If none of these things work, then your laptop may be overheating. Blowing the dust out of the fan will help with that, or running the system with extra space below the laptop so it can get more air. The best idea to correct this would be to open the case, remove the fan and clear the dust from it and the vents, but many people are not comfortable doing that.
The next step would be to update the system BIOS (many include fixes for problems of this type) and update video drivers. Next, I would probably test the RAM and the hard drive with the utilities typically present in the HP BIOS (but may not be present on lower-end models). MemTest86 works for testing memory, but testing the disk is more difficult. Failed disks and memory usually exhibit different symptoms than this, though. That's why I didn't mention it earlier.
If possible, try running the laptop with a Live Linux CD for a couple hours to see if the symptoms persist in a completely different OS. If so, then it's a hardware problem.
If you've done all of the above and the Linux CD doesn't have any problems, then personally I'd just reinstall Windows and see if the problem persists.