To fix this, go to control panel and click classic view in the sidebar of the control panel. Then look for power options or something like that. Choose to edit your current settings. There's a big list of options here. Look for the option for what the computer should do when you close the lid. You can also change the option of what to do for the start menu power button and the MBPs power button.
Note: You might want to watch out for heat issues since your computer will be running while the lid is closed.
You can change these same options in Windows XP as well.