Questions tagged [close-application]
37 questions
51
votes
4 answers
Right way to close WPF GUI application: GetCurrentProcess().Kill(), Environment.Exit(0) or this.Shutdown()
My GUI desktop-based WPF 4.0 (C# .Net 4.0) program works with SQL Server database. Each time when I run my application it creates a connection to SQL Server via ADO.NET Entity Framework and if SQL Server is not reachable it throws an exception and…

Mike
- 14,010
- 29
- 101
- 161
32
votes
3 answers
Android: OnDestroy isn't called when I close the app from the recent apps button
When we press this button
We see the apps which we didn't close, like this
But when we want to close an app from this screen (below image), the method onDestroy() isn't called, however the app is closed. I need to call onDestroy() when the app is…

Curio
- 1,331
- 2
- 14
- 34
19
votes
8 answers
how to close android app completely
I created an android application with a logout option in onCreateOptionsMenu. The Logout works perfectly but when I press the back button again it takes me to the previous activity, and when it gets a null value it redirects to login screen. Now my…

Brett
- 431
- 2
- 10
- 26
9
votes
3 answers
What is the preferred method of programmatically closing a C# WPF Application?
Which is the preferred method of closing a C# WPF Application?
1) calling Window.Close() within the Main Window
2) Calling Application.Current.Shutdown( 0 ) within the Main Window.
Are the two semantically equivalent or is there a subtle distinction…

TK.
- 46,577
- 46
- 119
- 147
9
votes
1 answer
CloseApplication while uninstalling - wix
I am using Wix 3.6. I have an issue, while uninstalling if any window is open and shown in task bar (this window is a part of my msi, which I am trying to uninstall), it is showing a dialog box asking the user to close the application (“The…

sanam_bl
- 299
- 1
- 7
- 14
8
votes
3 answers
Wix's util:CloseApplication extension doesn't seem to work
I'm trying to close a process before uninstallation using Wix. I've confirmed that it works as long as there's a visible window, but if there isn't a visible window (which is the case most of the time with this app since it's a system tray app), the…

Daniel Schaffer
- 56,753
- 31
- 116
- 165
3
votes
3 answers
Clojure: exit program when Window Frame is Closed
I'd like my Clojure program to exit when a JFrame is closed.
I'm attempting to trap and handle the close event as such:
(def exit-action (proxy [WindowAdapter] []
(windowClosing [event] (fn [] (System/exit 0)))
…

SMTF
- 705
- 10
- 16
3
votes
0 answers
Is there any android service callback function that is being called after System.exit()?
I have a button that is supposed to finish the entire application when being pressed.
The button press opens a dialog, and after a password is inserted the dialog's positive listener supposed to close the application.
This is the dialog's positive…

Daniel
- 1,895
- 9
- 20
3
votes
2 answers
How to force the closing of an Electron app?
I have an electron app that loads the URL of the web version of the app.
However I cannot close the application by clicking in the X button and I dont have access to the webapp.
I have tried this:
let count = BrowserWindow.getAllWindows().length;…

kkica
- 4,034
- 1
- 20
- 40
3
votes
4 answers
Excel still running after close vb.net app
I'm having some problems closing Excel files. I am doing a program that opens some Excel files, uses the information and then close them.
I tried some different codes, but they didn't work because the EXCEL process is still running.
My first…

Paula Lopes
- 61
- 1
- 8
3
votes
1 answer
WP8 Save file with http request in Background task when the app closes
I would like to store data in the dropbox via http request when the app closes. The time of 10 seconds in the Application_Closing function are not enough. Is there a background task that runs longer after closing the app?
Thank you

Claudia_letsdev
- 273
- 4
- 9
2
votes
2 answers
End Application in C #
As a sample below, I am using an If statement for my Application, where if you press Yes, the Application should close. I click Yes, and No, and the Application just continues regardless. Does anyone know why this might happen?
if…
user8591026
2
votes
1 answer
how to know the app is closed or not when i have minimize the app and side swipe that app in codename one?
i have install my app in android tablet.i have maintain the sessions for logged in users, for this purpose i want to know the app is closed or just minimized the app by the client.suppose if i have minimized the app and swipe that app (i.e…

Mamatha Damuluri
- 119
- 5
2
votes
1 answer
is it possible to close apps programatically which are running in background in android?
I want to stop or close apps which are running in background in android. Is it possible? If so how to achieve this. Refer any links will be appreciated.
Thanks in advance..

Shailendra Madda
- 20,649
- 15
- 100
- 138
1
vote
1 answer
how can I save objects after closing my Android application?
I am making a small game and I want to save all the variables (objects and basic types) when closing the app to be able to load the saved game later on.
Here are some of the variables:
String playerName;
Duration time;
Item[]…

JAgüero
- 403
- 1
- 4
- 14