A friend of mine was suffering from this problem. It can occur when windows requests all programs terminate, then shuts down. If a program hangs, windows can be left waiting for it to finish, and then we're stuck. It's difficult to work out what program is causing the trouble, in the case of my friend it turned out to be the aol software.
First of all I would try shutting down the computer by forcing all applications to terminate without warning. Click start -> run. Then type "shutdown -s -f -t 10" without quotes. This will hopefully simply end all programs and shutdown as normal. If this works then we know the problem is a program crashing while ending.
If this problem started when installing these two programs then uninstall them and see if it fixes itself. If it does, the best I can suggest is reinstall and hopefully the problem will have gone away. Else use an alternative program.
If the shutdown method above doesn't work, then i'm afraid i'm stuck. It's still likely to be a program crashing on close, but i'm not sure how you would find out which one. Sorry I can't be of more help.