Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » TopWindow&PopUp, TrayIcon » How to check whether application is running
Re: How to check whether application is running [message #38774 is a reply to message #38772] Wed, 16 January 2013 17:02 Go to previous messageGo to previous message
nlneilson is currently offline  nlneilson
Messages: 644
Registered: January 2010
Location: U.S. California. Mojave &...
Contributor
Alboni wrote on Wed, 16 January 2013 03:29


CloseHandle(mutex);


lectus wrote on Wed, 16 January 2013 05:38

The app needs to delete the file before finishing.


Alboni wrote on Wed, 16 January 2013 06:44


Disadvantage is that the program doesn't want to start anymore after a crash,


Spent many hours related to this. That is ending a thread correctly.

CloseHandle(mutex);
delete the file before finishing
etc.

Which results in:
program doesn't want to start anymore after a crash,

A thread in many respects is like a separate application.
If it is not ended correctly it causes problems like an app cannot be started again until that thread is closed.

Or for something like a GPS USB receiver if the thread that it is run in does not close that port connection there is no easy way to close that except to pull the plug.

If a socket server has a port open another instance of that app or any other app that uses that port will not run unless error handling changes to another port number.

The best way I have found to close a thread is from INSIDE that thread.

There are many ways to check if an app is running but if that app crashes it can leave something hanging. Task Manager in Win, System Manager in Ubuntu, etc. is good if you know what you are looking for to close that thread.

To deploy an app this needs to be considered and have error handling and even instruction for a user.

If there is some 'magic' option it would be good to know.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: TopWindow minimum size
Next Topic: Timeout on PromptYesNo?
Goto Forum:
  


Current Time: Wed May 08 10:34:35 CEST 2024

Total time taken to generate the page: 0.01448 seconds