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. │ └───────────────┴─────────────────────────────────────────────┘