i need to know how the Mac OS closes the running application when shutdown is pressed,
i am working in flex and want to capture that event (if that is an event or else) to stop closing my app state away.
i need my app to ask for close the app YES or NO. on yes resumes the shutdown and on no do not close the app and shutdown processes it also stopped.
need help
regards.
I'm not sure of anything Mac specific.
But can you add an event listener on the WindowedApplication for the close event? Also look at the closing event to do something before the app window closes.
I assume closing the main app window is the same as exiting the application.
Related
I'm using a barcode scanner (LS2208 OPOS mode) in an application and every time I close it the scanner is disabled. It starts to work again when I reopen the app.
In my app there is no call to disabled it, so why is this happening? Is this normal ?
The same thing happens with the sample app in the POS for .NET SDK
That is normal behavior.
Calls such as Close or Release method(Release is exclusive device only), or application termination or abort, will disable the OPOS/POS for.NET device.
However, termination or abort of the application may not be disable depending on timing.
It is considered a bug in either OPOS/POS for.NET/application.
Is it possible to detect in Flex application browser window close event so that an action can be
started when user closes Flex application, does anyone know how to do that if it's possible in the
first place? The reason why i am asking this is because i have a multiuser Flex application where
every user has it's own directory on a server side. Application has logout button which triggers
cleanup of user's directory but what if the user just closes the window? I would like to be able
to lunch that same cleanup upon browser close window
In the page hosting your app, write a Javascript function triggered by window.onbeforeunload, and this function can call a function inside your Flex application.
Note that the onbeforeunload function is not guaranteed to work for all browsers.
I would not recommend that approach because the closing action fails too often, meaning worthless. My browser freezes and force-quitted several times a day. My computer sometimes freezes. My internet connection sometimes dies. I think, some browsers even do not guarantee those kinds of actions executed every time.
So, the session timeout might be one safe way in most cases.
You can also try having a socket connection, so that your server can ping if a user is alive and also can detect if socket is closed. Even socket, however, can be unresponsive or can be disconnected sometimes while user is still using the application.
You might want to be strategic.
i run a background thread in Application_Start() in global.asax
to use it like windows service
but applicaton_end fire when all session is ended in my website
i have a sms Business that work with webservice and i want to have agent in my server that
check incoming message like windows service
i increase session timeout to 10 hours but when i close browser application end fired and
my thread stop working
i cant change server properties
can i disable application_end to thread keep working?
I apologize to you because of poor english writing
You should make a separate program that runs as a service or a batch program to do that. Although ASP.NET persists static variables and such between page loads, you shouldn't be using it to run things in the background. There is no guarantee that things will keep running.
If you need something to happen on the user's end when something happens on the server (like a message received (like on facebook), someone responds to a request, or some other event is raised) you need to implement a polling system in javascript on the webpage that the user sees which uses AJAX (look it up...its such an awesome concept) to periodically talk to the server to see if anything happened. That is how Facebook chat works along with most webmail systems to check for new messages. The server doesn't talk to the browser...the browser asks the server if anything happened.
Here is an example of a chat program that uses AJAX: http://www.dynamicajax.com/fr/JSON_AJAX_Web_Chat-.html
It isn't exactly what you are doing, but it demonstrates the concept of trying to check something after the page has been loaded and making the user's browser respond.
Nay be use a .NET version of quartz-scheduler library (http://quartz-scheduler.org/) for defining and triggering a job based on the configuration (cron expresion).
iis automatically close website application when no session is open in website
for disable this you can change idle time in iis or read website link in global.asax (application_end) function to start a new session
Could you tell me how can I determine between QMainWindow close event initiated by user and abonormal termination by SIG_KILL in Linux or TerminateProcess() in Windows?
That's because the difference in urgency exists.
I can refuse closing by user or user can think as long as required.
But I have to save intermediate results and current state as soon as possible when aborting or till the user will do next fatal abort try.
I can try to figure out analysing the mouse position on closeEvent(). But it depends on the taskbar look. I can set the app to non-minimized state and wait the next user actions. But that's not a good behaviour in the abort case. User can try the next fatal abort actions or the time for save would lost.
Best regards, Gennady
If you application receives a SIGKILL, it will not have any time to do anything. It is terminated on the spot. You can't catch or block that signal. So you can't "differentiate" a SIGKILL from normal application shutdown: you will not know when you have been forcefully killed. (Same thing for TerminateProcess().)
If you need to do something during normal application shutdown, you should connect your cleanup routine to the QCoreApplication::aboutToQuit() signal. Check the docs, that is exactly what it is designed for.
Is that possible to achieve using Adobe Air or any other suggestion? I have an app which record user time and to prevent user don't forget i think similar solution will work.
Thanks!
You can bind a listener to close event for the application. When OS received shut down command, it'll try to terminate processes so your app will trigger close event. I haven't tested but hopefully this will work. At that moment, you can register user's session data. That's what other software do when you want to turn off, a little delay...