+ Reply to Thread
Results 1 to 3 of 3

Thread: How to find whether windows based application is hung or not?

  1. #1

    How to find whether windows based application is hung or not?

    Hi,

    I am trying to find out a way that windows based application is hung or not.

    Is there any way to find it out?

    Please help.

  2. #2
    You can use SendMessageTimeout with SMTO_ABORTIFHUNG flag.

    It returns false if destined window is in no respond state or hung.

    Example:

    Code:
    BOOL IsApplicationHung(HWND hWindow, int nTimePeriod)
    {
    	unsigned long lResult ;
    	return ::SendMessageTimeout(hWindow, WM_NULL, 0, 0, SMTO_ABORTIFHUNG, nTimePeriod, &lResult) ;
    }

  3. #3
    Great, this is what I needed.

+ Reply to Thread

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts