The class styles define additional elements of the window class. Two or more styles can be combined by using the bitwise OR (|) operator. The class styles are as follows:
Style | Description |
CS_BYTEALIGNCLIENT | Aligns the window's client area on a byte boundary (in the x direction). |
CS_BYTEALIGNWINDOW | Aligns the window on a byte boundary (in the x direction). |
CS_CLASSDC | Allocates one display context to be shared by all windows in the class. For more information about device contexts, see Section 1.2.12 |
CS_DBLCLKS | Sends double-click messages to the window procedure. |
CS_GLOBALCLASS | Specifies that the window class is an application global class. An application global class is created by an application or DLL and is available to all applications. The class is destroyed when the application or DLL that created the class closes; it is essential, therefore, that all windows created with the application global class be closed before the application or DLL closes. |
CS_HREDRAW | Requests that the entire client area be redrawn if a movement or size adjustment changes the width of the client area. |
CS_NOCLOSE | Inhibits the Close command on the System menu (sometimes referred to as the Control menu). |
CS_OWNDC | Allocates a unique display context for each window in the class. For more information about device contexts, see Section 1.2.12 |
CS_PARENTDC | Gives the parent window's display context to the child windows. For more information about device contexts, see Section 1.2.12 |
CS_SAVEBITS | Saves, as a bitmap, the portion of the screen image that is obscured by a window; Windows uses the saved bitmap to re-create the screen image when the window is removed. Windows displays the bitmap at its original location and does not send WM_PAINT messages to windows that had been obscured by the window if the memory used by the bitmap has not been discarded and if other screen actions have not invalidated the stored image. |
CS_VREDRAW | Requests that the entire client area be redrawn if a movement or size adjustment changes the height of the client area. |
To assign a style to a window class, an application assigns the style value to the style member of the WNDCLASS structure.