Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 481539
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T01:00:17+00:00 2026-05-13T01:00:17+00:00

Is it at all possible to detect when your application stops responding, so appropriate

  • 0

Is it at all possible to detect when your application stops responding, so appropriate action can be taken automatically, instead of the user having to go to task manager/end process and/or end task etc?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T01:00:17+00:00Added an answer on May 13, 2026 at 1:00 am

    Bear with me on this – it’s not a direct answer to your question, but rather some design advice to avoid getting into your situation. If your app is truly locked up and not responding the there’s really no way to detect it and respond. The trick is to avoid getting into the situation to begin with.

    In my experience, WinForms apps almost never just stop responding. Instead, they tend to appear unresponsive while performing long-running tasks or getting caught in infinite (or at least long running) loops.

    You can avoid this by putting long running processes in another thread, using multi-threading techniques. An easer trick that works for long running loops is to put the code

    Application.DoEvents()

    inside the loop. This will allow the app to appear responsive wile the loop is running, when it would normally just appear locked up.

    The way I normally handle this is by having a status label that I keep updated to let the user know the app is doing something like shown below:

    foreach(DataRow r in myTable.Rows)
    {
       StatusLabel.Text = "Now processing " + r[0].ToString();
       Application.DoEvents();
       ... now do the real work
    }
    

    This gives the user the feedback to let them know the app is actually doing something, and not just “Locked Up”. 99% of the time, the user perception is all that matters.

    Edit – added to answer the comment below

    Application.DoEvents() does include a performance hit. You need to decide on whether it’s worth it. Used as I’ve shown above (in combination with a progress indicator of some sort), it can eliminate user frustration, and I’ve found it to be a worthwhile trade-off for long running processes.

    My original answer mentioned the perception being all that matters 99% of the time. I’ll give an example of where I used it and felt it was justified.

    I inherited a WinForms application written by one of my predecessors. This application had a process that needed to be done weekly to summarize and process millions of records. On top of the large quantity of records, the database was not designed properly, and as a result the process took over an hour. So the user would be stuck at their computer for an hour watching this screen do nothing. They had no way of knowing if the app was actually working. I added the code above as a temporary measure and the end user was extremely grateful. He really appreciated knowing that the application was really working and not just hung up.

    Adding the application.DoEvents() brought the processing time up from an hour to an hour and five minutes or so. It was a noticeable slow-down, BUT the user was happier with it, because even though it took longer, he knew what it was doing.

    Incidentally, it made me happier as well because occasionally, when it took longer due to unusually high record counts, the user wold end task on the program and re-run it thinking it was locked up, This would inevitably lead to me having to spend hours fixing the data.

    As a final side note, I re-wrote the app from scratch, including redesigning the database, and the same process takes 5 seconds now. I add this not to brag, but to get you to think about why your app seems to be locking up. If you can approach the task in a way that is more efficient and get a better design, you can avoid this completely in a lot of cases.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 230k
  • Answers 230k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You should be able to use a caret (^) to… May 13, 2026 at 2:01 am
  • Editorial Team
    Editorial Team added an answer If you want to use your custom function in HQL,… May 13, 2026 at 2:01 am
  • Editorial Team
    Editorial Team added an answer @Joel's answer is pretty close, but it will fail in… May 13, 2026 at 2:01 am

Related Questions

This question sort of extends my other question on robots and captcha . I
I have a Java class that looks like this: public class My_ABC { int
A bit of an odd (challenging?) question. Is it possible to programmatically access the
Is it possible to detect if a page is opened in 2 different browsers?
Is there a way to know and output the stack size needed by a

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.