How to automatically disable secondary monitor in Windows 7
Solution 1:
In Windows 7, you can also hold down the Windows key and press "p" to cycle through the various monitor enabling/disabling options. I've found this to be the simplest way to do it by far.
Solution 2:
I'm not sure if there is a way to auto disable it when you turn it off, but there is a great utility called UltraMon
Once you have that you can setup a hotkey to enable/disable the secondary monitor. I use Ctrl + Alt + D, but you can map it whatever key combo you want: