But I'd have to guess this is a stock machine. Which Windows and more.
But let's get you started with prior discussions on shutdown failures.
http://h10025.www1.hp.com/ewfrf/wc/product?cc=us&lc=en&dlc=en&product=1140029 is the home page to your machine.
Did you try the "Solve a problem" button?
Now that you know which OS matters as well as what's been added since it worked, you can tell more.
from Start button to "turn off computer" when I click "restart" button, the computer begins the process of restarting, goes blue, etc. but at one point freezes on black screen and won't restart. Have to shut off computer and start again. Any suggestions? HP Pavilion a1224n Product # ED 906AA Thanks