I had a problem when switching from my dual monitor setup to my projector and back. I wrote this simple ahk script that launches the commands that Brink posted above.
the problem was that sometimes when i turn off my projector the screen would not come back to my dual monitor setup, forcing me to turn the projector back on and manually hitting win + P to hit extended and everything would go back to normal.
Anyways, you will need to install autohotkey.
to use the attached script. the hotkeys are as follows:
ctrl+alt + E (For extended)
ctrl+alt + I (For Internal)
ctrl+alt + C (For clone)
ctrl+alt + P (for projector)
Note that you will need to change the extension from .txt to .ahk for it to be used with autohotkey. you can switch back to .txt for editing (change the shortcuts or whatever you like!)
hope this helps!