Much much easier way to do that!
While holding shift down, right click the application in the taskbar. The select maximize. The application is then maximized on the monitor that is available. The tricky part is that if you then click the restore button (next to the "X"), then it will disappear to the monitor that is not connected. However if you drag the window (click and hold the top of the window), it will start restoring and on the monitor that is till turned on.
This is a comment on "Bring lost window to main monitor (Win 7)"