MFC之常用窗口风格

来源:互联网 发布:安装 windows 卡着不动 编辑:程序博客网 时间:2024/05/01 23:45

CS_HREDRAW   如果窗口客户区宽度发生改变,那么重绘整个窗口。

CS_VREDRAW   如果窗口客户区高度发生改变,那么重绘整个窗口。

CS_DBLCLKS    当用户在属于该窗口类的窗口中双击鼠标时,就向该窗口过程发

送双击消息

CS_NOCLOSE  禁用窗口系统菜单中的关闭命令

CS_OWNDC  为该窗口类的各窗口分配各自独一的设备描叙表

CS_CLASSDC  为该窗口类的所用窗口分配一个共享的设备描叙表

CS_PARENTDC  指定子窗口继承其父窗口的设备描叙表

CS_SAVEBITS 把被窗口遮掩的屏幕图像部分作为位图保存起来。当该窗口被移走时,WINDOWS采用被保存的位图来重建屏幕图像。

 

CS_BYTEALIGNCLIENTAligns the window's client area on the byte boundary (in the x direction). This style affects the width of the window and its horizontal position on the display.CS_BYTEALIGNWINDOWAligns a window on a byte boundary (in the x direction). This style affects the width of the window and its horizontal position on the display.CS_CLASSDCAllocates one device context to be shared by all windows in the class. Because window classes are process specific, it is possible for multiple threads of an application to create a window of the same class. It is also possible for the threads to attempt to use the device context simultaneously. When this happens, the system allows only one thread to successfully finish its drawing operation. For more information, seeDevice Contexts.CS_DBLCLKSSends double-click messages to the window procedure when the user double-clicks the mouse while the cursor is within a window belonging to the class.CS_GLOBALCLASSAllows an application to create a window of the class regardless of the value of thehInstance parameter passed to the CreateWindow orCreateWindowEx function. If you do not specify this style, thehInstance parameter passed to the CreateWindow (or CreateWindowEx) function must be the same as the hInstance parameter passed to theRegisterClass function. You can create a global class by creating the window class in a dynamic-link library (DLL) and listing the name of the DLL in the registry under the following keys: HKEY_LOCAL_MACHINE\Software
\Microsoft\Windows NT\
CurrentVersion\Windows\AppInit_DLLs Whenever a process starts, the system loads the specified DLLs in the context of the newly started process before calling the entry-point function in that process. The DLL must register the class during its initialization procedure and must specify the CS_GLOBALCLASS style.CS_HREDRAWRedraws the entire window if a movement or size adjustment changes the width of the client area.CS_NOCLOSEDisables Close on the window menu.CS_OWNDCAllocates a unique device context for each window in the class.CS_PARENTDCSets the clipping region of the child window to that of the parent window so that the child can draw on the parent. A window with the CS_PARENTDC style bit receives a regular device context from the system's cache of device contexts. It does not give the child the parent's device context or device context settings. Specifying CS_PARENTDC enhances an application's performance. For more information, seeDevice Contexts.CS_SAVEBITSSaves, as a bitmap, the portion of the screen image obscured by a window. The system uses the saved bitmap to re-create the screen image when the window is removed. The system displays the bitmap at its original location and does not sendWM_PAINT messages to windows 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. This style is useful for small windows (for example, menus or dialog boxes) that are displayed briefly and then removed before other screen activity takes place. This style increases the time required to display the window, because the system must first allocate memory to store the bitmap.CS_VREDRAWRedraws the entire window if a movement or size adjustment changes the height of the client area.

 

原创粉丝点击