Have you checked the air vent for the processor. if this is clogged with Cr*p it will cause the processor to get to hot and shut down.
Get a can of compressed air (maplins) and give it a blast to clear it out.
I have the same problem with my HP especially while gaming or playing Hi-def movies.
intel core2 2.5GHz
4G RAM - 512MB NVIDIA
This works for me most of the time. I keep my laptop elevated from the resting surface (such as a table, etc) by about 2-3 inches by supporting the laptop on a box or book at two ends (Make sure the RAM and fan areas are unblocked by whatever ur resting the laptop on). Also I keep a small table fan on next to the laptop to make sure that there is cool air being blown across the bottom surface of the laptop.
I know this is very abstract way to deal with the issue but it works for me...usually a game/app that would overheat my laptop and cause it to shut in 20 mins or so, no I can run it for upto 3 hours continuous easily with this method.
This is the second HP laptop I've had and BOTH had overheating problems right from the start. The first one, I had a tech open it up and paint something on the Heat sync. That seemed to solve it. That didn't cost me anything because I worked for a computer repair company. I don't anymore and I don't want to have to pay someone to do something that should be done at manufacturer. I have to set my laptop on a tray filled with ICE to keep it cool. The ice melts really fast and I have to keep refilling it if I want to watch any movies. My icemaker can't even keep up. I HATE HP laptops. Back to Dell for me.