How To Detect If an Application Has Stopped Responding (231844)
The information in this article applies to:
- Microsoft Visual Basic Learning Edition for Windows 5.0
- Microsoft Visual Basic Learning Edition for Windows 6.0
- Microsoft Visual Basic Professional Edition for Windows 5.0
- Microsoft Visual Basic Professional Edition for Windows 6.0
- Microsoft Visual Basic Enterprise Edition for Windows 5.0
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
- Microsoft Internet Explorer (Programming) 4.01
- Microsoft Internet Explorer (Programming) 4.01 SP1
- Microsoft Internet Explorer (Programming) 4.01 SP2
- Microsoft Internet Explorer (Programming) 5
- Microsoft Internet Explorer (Programming) 5.5
This article was previously published under Q231844
For a Microsoft Microsoft Visual Basic
.NET version of this article, see 304990.
SUMMARY In many situations you may want to know if an application
is blocked. For example when you automate Microsoft Internet Explorer, you want
to know whether Internet Explorer stops responding.
This article
describes how to detect whether an automated instance of Internet Explorer
stops responding. Although the code is written for Internet Explorer and Visual
Basic, you can also use the following instructions for other applications.
The code uses the Win32 API SendMessageTimeout
function to determine whether the target application responds and then the API
call TerminateProcess to kill the hung instance of Internet
Explorer.
REFERENCESFor additional information, click the article
numbers below to view the articles in the Microsoft Knowledge Base: 129797 How To Launch a Win32 Application from Visual Basic
178893 How To Terminate an Application Cleanly in Win32
176391 How To Programmatically Close a Single Instance of a Windows-Based Program
Modification Type: | Minor | Last Reviewed: | 7/1/2004 |
---|
Keywords: | kbhowto KB231844 |
---|
|