A window that is a descendant of the desktop window can be either visible or invisible. The system displays a visible window on the screen. It hides an invisible window by not drawing it. If a window is visible, the user can supply input to the window and view the window's output. If a window is invisible, the window, in effect, is disabled. An invisible window can process messages from the system or from other windows, but it cannot process user input or display output. An application sets a window's visibility state when it creates the window. Later, a user or the application can change the visibility state.
The visible region of a window is the position clipped by any overlapping windows. These overlapping windows can be child windows or other main windows in the system. The visible region is defined by a set of one or more rectangles, as shown in the following figure.
ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ °°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°° ³ ³ ° A °°°°°°°°°°°° ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ °°°°°° ³ ³ °°°°°°°°°°°°°°°° ³ B ³ °°°°°° ³ ³ °°°°°° ÚÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄ¿ ³ °°°°°° ³ ³ °°°°°° ³ C ³ ³ °°°°°° ³ ³ °°°°°° ³ ÃÄÄÄÄÄÄÄÄÄÙ °°°°°° ³ ³ °°°°°° ³ ³ °°°°°°°°°°°°°°°° ³ ³ °°°°°° ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ °°°°°°°°°° ÚÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄ¿ ³ °°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°° ³ D ³ ³ °°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°° ³ ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ÚÄÄÄÄÄÄÄ¿ ³ °°°°° ³ - Visible region for Window A ³ °°°°° ³ ÀÄÄÄÄÄÄÄÙ
Visible Region for Window A
A window is visible if the WS_VISIBLE style is set for the window. By default, the WinCreateWindow function creates invisible windows unless the application specifies WS_VISIBLE. The application often hides a window to keep its operational details from the user. For example, an application can keep a new window invisible while it customizes the window's appearance. An application can determine whether a window has the WS_VISIBLE style by using the WinIsWindowVisible function.
Even if a window has the WS_VISIBLE style, the user might not be able to see the window on the screen because other windows completely overlap it, or it might have been moved beyond the edge of its parent. A visible window is subject to the clipping rules established by its parent-child relationship. If the window's parent window is not visible, the window will not be visible. Because a child window is drawn relative to its parent's lower-left corner, if the parent window is moved beyond the edge of the screen, the child window also will be moved. In other words, if a user moves the parent window containing the child window far enough off the edge of the screen, the user will not be able to see the child window, even though the child window and its parent window have the WS_VISIBLE style. To determine whether the user actually can see a window, an application can use the WinIsWindowShowing function.