The class styles define additional elements of the window class. Two or more styles can be combined by using the bitwise OR operator. Table 1.2 lists the class styles:
Table 1.2 Window Class Styles
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. |
CS_DBLCLKS | Sends double-click messages to the window function. |
CS_GLOBALCLASS | Specifies that the window class is an application global class. An application global class is created by an application or library and is available to all applications. The class is destroyed when the application or library that created the class terminates; it is essential, therefore, that all windows created with the application global class be closed before this occurs. |
CS_HREDRAW | Requests that the entire client area be redrawn if a movement or adjustment to the size changes the width of the client area. |
CS_NOCLOSE | Inhibits the close option on the System menu. |
CS_OWNDC | Allocates a unique display context for each window in the class. |
CS_PARENTDC | Gives the parent window's display context to the window class. |
CS_SAVEBITS | Saves 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 which 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. |
Table 1.2 Window Class Styles (continued)
Style | Description |
CS_VREDRAW | Requests that the entire client area be redrawn if a movement or adjustment to the size changes the height of the client area. |
To assign a style to a window class, an application assigns the style value to the style field of the WNDCLASS structure.