Each window class has one or more values, called class styles, that tell the system which initial window styles to give a window created with that class. An application sets the class styles for a private window class when it registers the class. Once a class is registered, the application cannot change the styles.
An application can specify one or more of the following class styles in the WinRegisterClass function, combining them as necessary by using the bitwise OR operator:
ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³Style Name ³Description ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ ³CS_CLIPCHILDREN³Prevents a window from painting over its ³ ³ ³child windows, but increases the time ³ ³ ³necessary to calculate the visible region. ³ ³ ³This style usually is not necessary, because ³ ³ ³if the parent and child windows overlap and ³ ³ ³are both invalidated, the operating system ³ ³ ³draws the parent window before drawing the ³ ³ ³child window. If the child window is ³ ³ ³invalidated independently of the parent ³ ³ ³window, the system redraws only the child ³ ³ ³window. If the update region of the parent ³ ³ ³window does not intersect the child window, ³ ³ ³drawing the parent window causes the child ³ ³ ³window to be redrawn. This style is useful to³ ³ ³prevent a child window containing a complex ³ ³ ³graphic from being redrawn unnecessarily. ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ ³CS_CLIPSIBLINGS³Prevents a window from painting over its ³ ³ ³sibling windows. This style protects sibling ³ ³ ³windows but increases the time necessary to ³ ³ ³calculate the visible region. This style is ³ ³ ³appropriate for windows that overlap and have³ ³ ³the same parent window. ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ ³CS_FRAME ³Identifies the window as a frame window. ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ ³CS_HITTEST ³Directs the operating system to send ³ ³ ³WM_HITTEST messages to the window whenever ³ ³ ³the mouse pointer moves in the window. ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ ³CS_MOVENOTIFY ³Directs the system to send WM_MOVE messages ³ ³ ³to the window whenever the user moves the ³ ³ ³window. ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ ³CS_PARENTCLIP ³Extends a window's visible region to include ³ ³ ³that of its parent window. This style ³ ³ ³simplifies the calculation of the child ³ ³ ³window's visible region but, potentially, is ³ ³ ³dangerous, because the parent window's ³ ³ ³visible region is usually larger than the ³ ³ ³child window. ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ ³CS_SAVEBITS ³Saves the screen area under a window as a bit³ ³ ³map. When the user hides or moves the window,³ ³ ³the system restores the image by copying the ³ ³ ³bits; there is no need to add the area to the³ ³ ³uncovered window's update region. This style ³ ³ ³can improve system performance, but also can ³ ³ ³consume a great deal of memory. It is ³ ³ ³recommended only for transient windows such ³ ³ ³as menus and dialog windows-not for main ³ ³ ³application windows. ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ ³CS_SIZEREDRAW ³Causes the window to receive a WM_PAINT ³ ³ ³message and be completely invalidated ³ ³ ³whenever the window is resized, even if it is³ ³ ³made smaller. (Typically, only the uncovered ³ ³ ³area of a window is invalidated when a window³ ³ ³is resized.) This class style is useful when ³ ³ ³an application scales graphics to fill the ³ ³ ³window. ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ ³CS_SYNCPAINT ³Causes the window to receive WM_PAINT ³ ³ ³messages immediately after a part of the ³ ³ ³window becomes invalid. Without this style, ³ ³ ³the window receives WM_PAINT messages only if³ ³ ³no other message is waiting to be processed. ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ