473,387 Members | 1,834 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Difficult Task

Hi all! I have a very difficult task for me and i can't so it. My task:

I have created an application. But how to determine that it is not
responding??? You can see it when windows add "Not Responding" to
application title, but how to catch it from application?

I hope you'll help...
Aug 15 '06 #1
4 1319
Hello Laserson,

Heh. Lets examine what you are asking...
You want your application, which has stopped responding, to itsself generate
a response detailing it's non-responsiveness. That's like shooting a guy
in the head and then asking to the corpse to call the morgue and arrange
it's own funeral. Neat trick if it were possible.. but no possible with
our current technology.

Only thing you can do is duplicate the Task Manager functionality.. monitor
your process from another application.

-Boo
Hi all! I have a very difficult task for me and i can't so it. My
task:

I have created an application. But how to determine that it is not
responding??? You can see it when windows add "Not Responding" to
application title, but how to catch it from application?

I hope you'll help...

Aug 15 '06 #2
Laserson,

The same as

"Can God lift a stone that he has made himself not liftable"

Cor

"Laserson" <la******@yandex.ruschreef in bericht
news:ee**************@TK2MSFTNGP06.phx.gbl...
Hi all! I have a very difficult task for me and i can't so it. My task:

I have created an application. But how to determine that it is not
responding??? You can see it when windows add "Not Responding" to
application title, but how to catch it from application?

I hope you'll help...

Aug 16 '06 #3
Boo

nice answer,

Cor

"GhostInAK" <gh*******@gmail.comschreef in bericht
news:be**************************@news.microsoft.c om...
Hello Laserson,

Heh. Lets examine what you are asking...
You want your application, which has stopped responding, to itsself
generate a response detailing it's non-responsiveness. That's like
shooting a guy in the head and then asking to the corpse to call the
morgue and arrange it's own funeral. Neat trick if it were possible.. but
no possible with our current technology.

Only thing you can do is duplicate the Task Manager functionality..
monitor your process from another application.

-Boo
>Hi all! I have a very difficult task for me and i can't so it. My
task:

I have created an application. But how to determine that it is not
responding??? You can see it when windows add "Not Responding" to
application title, but how to catch it from application?

I hope you'll help...


Aug 16 '06 #4
It is possible, and simple - so you don't have to shoot yourself in the
hand.

"Not responding" means that the main thread is not responding to
messages - it does not mean that the application is hanging.

You can try to use a backgroundthread, wich checks the program using
GetProcessesByName.

Sample:

Public Class Form1
Private WithEvents bgt As New System.ComponentModel.BackgroundWorker

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Show the form
Me.Show()
Me.Refresh()
'Start the background worker
bgt.RunWorkerAsync()

Do
'and hang the app
Loop

End Sub

Private Sub bgt_DoWork(ByVal sender As Object, ByVal e As
System.ComponentModel.DoWorkEventArgs) Handles bgt.DoWork
Dim myprocess As Process = Process.GetCurrentProcess()

Do
Threading.Thread.Sleep(1000)
If myprocess.Responding Then
Debug.Print("Responding")
Else
Debug.Print("Not responding")
End If
Loop
End Sub
End Class

Cor Ligthert [MVP] wrote:
Boo

nice answer,

Cor

"GhostInAK" <gh*******@gmail.comschreef in bericht
news:be**************************@news.microsoft.c om...
>Hello Laserson,

Heh. Lets examine what you are asking...
You want your application, which has stopped responding, to itsself
generate a response detailing it's non-responsiveness. That's like
shooting a guy in the head and then asking to the corpse to call the
morgue and arrange it's own funeral. Neat trick if it were possible.. but
no possible with our current technology.

Only thing you can do is duplicate the Task Manager functionality..
monitor your process from another application.

-Boo
>>Hi all! I have a very difficult task for me and i can't so it. My
task:

I have created an application. But how to determine that it is not
responding??? You can see it when windows add "Not Responding" to
application title, but how to catch it from application?

I hope you'll help...

Oct 27 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

54
by: Spammay Blockay | last post by:
I've been tasked with doing technical interviews at my company, and I have generally ask a range of OO, Java, and "good programming technique" concepts. However, one of my favorite exercises I...
0
by: mystique | last post by:
I have a strange SQL Server 2000 DTS problem. I have a DTS Package that has three tasks in it. The first task is an Execute SQL Task that writes an entry to a log table, truncates a different table...
5
by: Grahammer | last post by:
Sorry for the whining, but I'm getty VERY frustrated trying to do some very simple jobs with DotNet and finding out that they are just impossible or involve a LOT of work. - Print a RichTextBox...
1
by: forums_mp | last post by:
Come to think of it I have another question: With respect to priority task1 is the highest, task2 is the lowest. The snippet: SEM_ID task1_sema = semBCreate(SEM_Q_FIFO, SEM_EMPTY); SEM_ID...
1
by: Wesley Gibbs | last post by:
The Steps I do to create and run my task are as follows: 1) I open up Control Center 2) From the Control Center I click Tools to open the Task Center Window 3) I create a Task and it is shown...
0
by: tom | last post by:
Hallo, I need help on MIDI file, and precisely about retrieving few note values (mainly the "Velocity" value, corrisponding to the intensity of a played note) while the MIDI is playing.
2
by: Eniac | last post by:
*argh* ... *pull hairs* I've recently started developing from ASP to ASP.NET The switch was fairly smooth since i had done some VB.net before ... then came...FORMS! :) I find it astounding...
0
oll3i
by: oll3i | last post by:
import javax.swing.*; import java.awt.event.*; import java.util.ArrayList; import java.util.List; import java.util.concurrent.*; import java.lang.reflect.*; public class Exec1 extends JFrame...
4
by: =?iso-8859-1?B?VmFyZ2hq5HJ0YQ==?= | last post by:
Hi, I shall try to be short and to the point, this is a problem that no one IRL has yet been able to help me with thus far. Yet it feels as thought this is something that many people must tackle...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.