How To Enumerate Windows Using the WIN32 API (183009)
The information in this article applies to:
- Microsoft Visual Basic Learning Edition for Windows 6.0
- Microsoft Visual Basic Professional Edition for Windows 6.0
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
- Microsoft Visual Basic Control Creation Edition for Windows 5.0
- Microsoft Visual Basic Learning Edition for Windows 5.0
- Microsoft Visual Basic Professional Edition for Windows 5.0
- Microsoft Visual Basic Enterprise Edition for Windows 5.0
This article was previously published under Q183009 SUMMARY
You can list Windows, including Child Windows, using the GetWindow API.
However, an application that calls GetWindow to perform this task risks
being caught in an infinite loop or referencing a handle to a window that
has been destroyed. Using EnumWindows for top-level Windows and
EnumChildWindows for Child Windows or EnumThreadWindows for all non-child
windows associated with a thread is a preferred method and is demonstrated
in this article.
REFERENCES
For more information, please search on the following topics in either the
Win32 Programmer's Reference or the Microsoft Developer Network (MSDN)
Library CD-ROM:
- EnumWindows
- EnumChildWindows
- EnumThreadWindows
- GetDesktopWindow
- GetClassName
- GetWindowRect
- GetWindowText
- GetWindowThreadProcessId
- MoveWindow
Modification Type: | Minor | Last Reviewed: | 7/1/2004 |
---|
Keywords: | kbAPI kbhowto KB183009 |
---|
|