Is there an equivalent of exit() for quitting a smartdevice application ?

  • Thread starter Thread starter Eric
  • Start date Start date
E

Eric

How can I quit a smartdevice application ?

After I click the right-hand(up) "X" button in the Pocket
PC 2002 Emulator,it seems that the smartdevice
application has not been closed.
(My smartdevice app has three forms.
Every form has a "X" button which is close to
the time information.)
Why? what happened when I click the button?

thx for answering my qestion.^^
 
Eric said:
How can I quit a smartdevice application ?

After I click the right-hand(up) "X" button in the Pocket
PC 2002 Emulator,it seems that the smartdevice
application has not been closed.
(My smartdevice app has three forms.
Every form has a "X" button which is close to
the time information.)
Why? what happened when I click the button?

thx for answering my qestion.^^

For some reason the "X" is a *minimize* button. When you disable
the minimize button you will get an "ok" button, which is the real "close"
button.

Apparently smart-device applications should never close, instead they should
minimize. The O/S will make sure not more than one version of the app
is running. It is however up to the programmer to free up resources
on "minimize".

Hans Kesting
 
If I use a socket to connect to a server in my smart-
device application,does the "ok" button free up all
resources including the socket?

It's more easier and natural for me to use the "ok"
button to close my app and free up all resources.And then
start my app again whenever I want.The "X" button really
makes me confused when I want to restart my app.
Can I just use the "ok" button in my app or it's better
for me to use the "X" button ?
 
To add to this, the main form must have its "MinimizeBox" property set to
false. Otherwise, when the X is clicked on the main form, the application
will be minimised, rather than exiting. One problem with this, is that when
the "MinimizeBox" property is changed, the X in the top right hand corner
changes to an "Ok" button. As far as I know, there is no way around this.

Hope this helps,

Mun
 
No it doesn't. The MinimizeBox property can be set to true. I just tested
this and calling Close() from inside MyForm1 results in the process exiting
cleanly. I don't set the MinimizeBox property to false in any of my
applications.

jim
 
Are you testing this on the emulator or the Pocket PC device itself? As far
as I remember, clicking the X on the emulator would cause the process to
exit, regardless of the what the MinimizeBox property was set to. However,
on the handheld device, if this property was set to true, clicking on the X
would simply cause the application to minimise, rather than exit.
Re-launching the application would simply restore its window and resume from
where it was minimised.

Regards,

Mun
 
I tested on both. You are correct, clicking the X will minimize the app. I
wasn't saying clicking the X would terminiate the app, sorry for the
misunderstanding. What I was saying is calling Close() from inside the code
will terminate the application. He could add a close button, menu item, or
catch any message he wants and call the Form.Close() method.

jim
 
Back
Top