Inside a Windows Application
This section focuses on the areas that are of greatest interest to us in using subclassing and hooks effectively. If you are interested in learning more about these subjects, pick up a copy of Win32 API Programming with Visual Basic by Steven Roman. He gives these topics a very thorough explanation.
Window Relationships
All windows are related in some
way to one or more other windows. The most common type of window
relationship is the
parent-child
relationship. Other types of relationships include owner-owned and
top-level windows.
Although
information on the relationship of one window to another is not a
requirement to understanding subclassing or hooks, it is very
helpful. This information will come into play more as I discuss
subclassing the common dialog boxes and as I get into the specifics
of hooks, such as the WH_SHELL
hook. For example,
the WH_SHELL
hook only provides information on
top-level, unowned windows.
Central to defining the relationship among windows is the concept of Z-order. When windows are drawn on the screen, only one window can be active at any time. This active window receives user input through the mouse and keyboard. This window also overlaps all other displayed windows on the screen. The windows below the active window are stacked one on top of the other; this is illustrated in Figure 2-1. You can think of this stack of windows as being similar to a stack of paper. The piece of paper on the top of the stack is the topmost ...
Get Subclassing and Hooking with Visual Basic now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.