I understand that we can use the function SendMessageTimeout to check if a window is hang. But how about a thread, that didn't call GetMessage ? Thanks.
Printable View
I understand that we can use the function SendMessageTimeout to check if a window is hang. But how about a thread, that didn't call GetMessage ? Thanks.
One easy possibility could be to raise a counter in your thread and just check wheter the variable has changed in another part of your application. If not in a given time, your thread hangs.
Not nice, but should work.
Marc
actually i am doing it now, but just wondering if there is any "System Function" that I can use to make the work ease.
You want to check whether a thread without a window is still responding?
If so, there is no standard way of doing that i guess. If the thread responds to certain messages, you could try to send a message to it and wait for a response. However, if the thread is for example a workerthread and loops infinitely doing some work, I don't there isn't a way to detect if it's hung or not.
What exactly do you want to do?
[ removed post from this thread ]
Please do not cross post your question
As Marc from D specified just put a Timer and Check for Response.if you are not getting response in that much time means your thread is hangOut.then kill your Thread