All About Windows

All you need to know to undermine Windows, generate chaos, and muck up the system is the handle of any window you want to trash. Normally, of course, you want to enhance Windows, not subvert it. You’ll discover lots of legitimate uses for window handles inside and outside your program.

In the Windows environment, almost any distinct element that you see on the screen is a window. Visual Basic programmers might think of forms as windows, but in fact most controls—command buttons, list boxes, scroll bars, option buttons, and check boxes—are also windows. Any object that has an hWnd property is a window at heart. The hWnd property is the link between the Visual Basic world of forms and controls and the SDK world of windows, dialogs, and the pitiful version of controls known to C programmers.

WinWatch provides several features for exploring windows. At any point, the Window, Process, and Module areas tell you more than you need to know about the current window. You can change the current window by clicking an item in any of the list boxes except Resources, by navigating the window hierarchy outline, or by clicking the Point button and pointing to a window. This section looks at the code that makes these features work.