Questions tagged [application-close]

31 questions
7
votes
2 answers

Android: BackStack misbehaves, if application was started from another app

I have an application, which starts with a SplashScreenActivity. Afterwards, a LoginActivity is shown, or if the user is already logged in, a MainActivity is shown. If the application is already running, SplashScreenActivity is dismissed with the…
longi
  • 11,104
  • 10
  • 55
  • 89
6
votes
3 answers

applicationWillTerminate not called

I implemented applicationWillTerminate method, but it's never called -(void)applicationWillTerminate:(NSNotification *)notification { [[NSApplication sharedApplication] terminate:self]; NSLog(@"EOP"); } How to execute some code before…
Ilya Blokh
  • 11,923
  • 11
  • 52
  • 84
5
votes
4 answers

Disable Alt+F4 but allow the form to be closed by code, CloseReason.UserClosing is not helping

I want that the form will not close by doing Alt + F4 but if Application.Exit() or this.Close is called from the same Form, it should be closed. I tried CloseReason.UserClosing but still no help.
Rick2047
  • 1,565
  • 7
  • 24
  • 35
5
votes
3 answers

Task manager close is not detected second time in a WinForms Application

private void Form1_FormClosing(object sender, FormClosingEventArgs e) { if (e.CloseReason == CloseReason.UserClosing) { if (MessageBox.Show(this, "Do you really want to close?", "Close?", …
Samir
  • 3,923
  • 9
  • 36
  • 43
5
votes
3 answers

Gracefully closing multithreading application?

I have an application that has two threads. The first one (the main thread) that captures the data using socket and update DataTables The second Inserts the DataTables into the database. The application works fine but when it closes, the main thread…
Ahmed
  • 7,148
  • 12
  • 57
  • 96
4
votes
2 answers

How to disable the close button in C?

Does anyone know how to disable the close button on a windows console window with an .exe executable that was created from a C program?
3
votes
4 answers

When to call PostQuitMessage

Like many applications, mine creates multiple windows. I do not know and cannot keep track of how many windows have been created, so I don't know when there are none. My problem is that when all the windows are closed, unless I call PostQuitMessage…
Seth Carnegie
  • 73,875
  • 22
  • 181
  • 249
3
votes
2 answers

Angular 2 call http before the user close the window

I want to save changes just before the user close the window, but it don't works when I quit the tab. I'm using router's canDeactivate method and it works when I refresh my page with F5, but when I close the tab datas are not saved. Here is my…
Mattew Eon
  • 1,722
  • 1
  • 21
  • 38
3
votes
4 answers

C++ - How to execute a command on application exit?

I am very new to C++ and have recently started a project for which I need to access a device, collect certain data and forward it to a datastream on a local network. While my application does all the things require it lacks on function: When I close…
Jonidas
  • 187
  • 4
  • 21
2
votes
1 answer

java, Declaring an method which runs before application close

I want to make some actions just before my application close. I see there are action listeners but i have no frame or similar thing. Just an only java file. How can I able to set some kind of control?
kubudi
  • 658
  • 1
  • 9
  • 20
2
votes
0 answers

Application unexpectedly shutting down due to WM_CLOSE messages

I have an MFC Dialog app that runs in the notification area (the system tray). It occasionally just shuts down with no rhyme or reason. After years of fighting this, thinking it was memory corruption or something, I added some logging. It turns out…
KokoCa
  • 131
  • 9
2
votes
3 answers

How can i do something before app is closed?

I have made an App in android in which i have a TCP Client but now i want to send a message to the server only when the app is going to be closed, i've trying to add the openConnection (opening connection with TCP Client) and sendMessage (Sending…
John K
  • 371
  • 5
  • 26
1
vote
0 answers

Pywinauto: Tree information lost after close of system dialog

I have a menu window of a propietary uia application which raises a subwindow. This subwindow raises a system file dialog window. All three windows have a full tree information which I can display by dump_tree(). When the system file dialog window…
1
vote
1 answer

C# UWP closing application multiple views

I have a UWP app that dynamically creates another view. But, the problem is when I close the first window, the second still stays on. With this code I am creating new view: CoreApplicationView newView = CoreApplication.CreateNewView(); …
user3239349
  • 877
  • 1
  • 12
  • 33
1
vote
1 answer

Windows Phone : Event when you close app in the active app list

If I close my app with the back-button, the event Application_Closing is raised and the code is executing. When I close my app in the list with active apps, no event is raised... I really need an event for this. Does anyone know a solution?
ceuben
  • 319
  • 1
  • 4
  • 17
1
2 3