S
Shannon Lloyd
Hi,
The main form of my application has MinimizeBox set to the default
(true), which is how I want it (and, according to MS, how it should be),
but I have a particular instance where I want to force my application to
exit completely. I would have thought that Application.Exit() would have
been able to accomplish this (ie that it would have forced an exit even
if the main form had been set to minimise itself on close. However, this
seems not to be the case - Application.Exit() does not dispose of my
main form; it merely closes all windows. I've tried changing MinimizeBox
to false before calling Application.Exit(), but this appears not to work
(can this property not be changed once the form has been initialised?).
Does anyone know of a way that I can get my application to force itself
to exit while keeping MinimizeBox set to the default/true value? Is
there perhaps a way to use P/Invoke to kill the process (from within
itself)?
Thanks,
Shannon
The main form of my application has MinimizeBox set to the default
(true), which is how I want it (and, according to MS, how it should be),
but I have a particular instance where I want to force my application to
exit completely. I would have thought that Application.Exit() would have
been able to accomplish this (ie that it would have forced an exit even
if the main form had been set to minimise itself on close. However, this
seems not to be the case - Application.Exit() does not dispose of my
main form; it merely closes all windows. I've tried changing MinimizeBox
to false before calling Application.Exit(), but this appears not to work
(can this property not be changed once the form has been initialised?).
Does anyone know of a way that I can get my application to force itself
to exit while keeping MinimizeBox set to the default/true value? Is
there perhaps a way to use P/Invoke to kill the process (from within
itself)?
Thanks,
Shannon