I didn't mention that this was for Desktop compilation. Its sometimes a dilema as to where to place the Form1.Show. If there is a lot of initialisation code in AppStart; showing the form early leaves it unresponsive until complete. Showing it late has your impatient users 'gunning' the application and you then have three instances of it open at the same time...
Here I have to show the form first, because I use Door to set MinimizeBox=True and MaximizeBox=False - they have to be applied to the form once its constructed. I also have a command line argument tha can set the form's WindowState to Minimized; if it is minimised, applying the MinimizeBox and MaximizeBox as above doesn't work.
The above is academic really as:
The corollary to the above is to not perform a Form.Show until you know the application is to start. Then the behaviour should be the same in the IDE and when compiled.
If you move Form1.Show to the end of AppStart in my little example you get an error:
Error loading program.
Cannot access a disposed object.
Object name: 'CEnhancedForm'.
It stands to reason, because I've already killed it with the AppClose above. So the upshot is that in an Optimised Compiled application, all the code in AppStart has to run. This would normally go un-noticed, however it was brought to my attention as I have a logging file created in AppStart - that is not required if the application does not have to run.