Auto Generate

Added support for the Auto Generate. Needs more testing. Added a check
of closing the Auto Generate Window before hitting exit.