窗口风格


1. Window Styles
 WS_BORDER    // 具有边框
 Creates a window that has a thin-line border.

 WS_CAPTION   // 具有标题栏(包含了边框)
 Creates a window that has a title bar (includes the WS_BORDER style).

 WS_CHILD    // 一个子窗口, 不能有菜单栏, 也不能雨具有 WS_POPUP 风格
 Creates a child window. A window with this style cannot have a menu bar.
 This style cannot be used with the WS_POPUP style.

 WS_CHILDWINDOW   // 类似与 WS_CHILD
 Same as the WS_CHILD style.

 WS_CLIPCHILDREN  // 裁减子窗口
      // 主要是用于父窗口,也就是说当在父窗口绘制的时候,父窗口上还有一个子窗口,
      // 那么设置了这个样式的话,子窗口区域父窗口就不负责绘制。
 Excludes the area occupied by child windows when drawing occurs within the parent window.
 This style is used when creating the parent window.

 WS_CLIPSIBLINGS  // 裁减兄弟窗口
      // 子窗口间相互裁减。也就是说当两个窗口相互重叠时,
      // 设置了WS_CLIPSIBLINGS样式的子窗口重绘时不能绘制被重叠的部分。
      // 反之没有设置WS_CLIPSIBLINGS样式的子窗口重绘时是不考虑重叠不重叠,统统重绘。
 Clips child windows relative to each other; that is, when a particular child window receives a WM_PAINT message,
 the WS_CLIPSIBLINGS style clips all other overlapping child windows out of the region of the child window to be updated.
 If WS_CLIPSIBLINGS is not specified and child windows overlap, it is possible,
 when drawing within the client area of a child window, to draw within the client area of a neighboring child window.

 WS_DISABLED   // 禁用窗口(一个禁用窗口无法从用户接收输入)
 Creates a window that is initially disabled.
 A disabled window cannot receive input from the user.
 To change this after a window has been created, use EnableWindow.

 WS_DLGFRAME   // 创建一个带对话框边框风格的窗口, 无法拥有一个标题栏
 Creates a window that has a border of a style typically used with dialog boxes.
 A window with this style cannot have a title bar.

 WS_GROUP    // 拥有此风格的窗口是一组控件(控制)中的首个控件。
      // 该控件组合是由这个首控件和在它之后定义的所有控件组成,
      // 直至到达下一个拥有WS_GROUP风格的窗口为止。
      // 每个控件组合的首控件通常也拥有WS_TABSTOP风格,这样的话,用户就可以在控件组之间进行移动。
      // 用户可以通过使用方向键,在一个控件组中,将键盘焦点从一个控件移动到该组的下一个控件。
      // 您可以靠打开 / 关闭这个风格来改变对话框的导航方式。要在一个窗口创建之后改变这个风格的话,
      // 可以使用SetWindowLong函数。
 Specifies the first control of a group of controls.
 The group consists of this first control and all controls defined after it,
 up to the next control with the WS_GROUP style.
 The first control in each group usually has the WS_TABSTOP style so that the user can move from group to group.
 The user can subsequently change the keyboard focus from one control in the group to the next control in the group by using the direction keys.
 You can turn this style on and off to change dialog box navigation. To change this style after a window has been created, use SetWindowLong.


 WS_HSCROLL    // 具有水平滚动条的窗口
 Creates a window that has a horizontal scroll bar.

 WS_ICONIC    // 创建的窗口一开始是最小化的
 Creates a window that is initially minimized. Same as the WS_MINIMIZE style.

 WS_MAXIMIZE   // 创建的窗口一开始是最大化的
 Creates a window that is initially maximized.

 WS_MAXIMIZEBOX   // 创建的窗口具有最大化按钮
 Creates a window that has a maximize button.
 Cannot be combined with the WS_EX_CONTEXTHELP style.
 The WS_SYSMENU style must also be specified.

 WS_MINIMIZE   // 类似于 WS_ICONIC
 Creates a window that is initially minimized. Same as the WS_ICONIC style.

 WS_MINIMIZEBOX   // 创建的窗口具有最小化按钮
 Creates a window that has a minimize button.
 Cannot be combined with the WS_EX_CONTEXTHELP style. The WS_SYSMENU style must also be specified.

 WS_OVERLAPPED   // 创建一个层叠窗口, 带有标题栏, 边框. 类似于 WS_TILED风格
 Creates an overlapped window.
 An overlapped window has a title bar and a border. Same as the WS_TILED style.

 WS_OVERLAPPEDWINDOW  // 创建一个带有WS_OVERLAPPED, WS_CAPTION, WS_SYSMENU, WS_THICKFRAME, WS_MINIMIZEBOX
       // WS_MAXIMIZEBOX风格的层叠窗口. 类似于 WS_TILEDWINDOW 风格
 Creates an overlapped window with the WS_OVERLAPPED,
 WS_CAPTION, WS_SYSMENU, WS_THICKFRAME, WS_MINIMIZEBOX, and WS_MAXIMIZEBOX styles. Same as the WS_TILEDWINDOW style.

 WS_POPUP    // 创建一个弹出的窗口, 这个风格不能和 WS_CHILD 风格一起使用
 Creates a pop-up window. This style cannot be used with the WS_CHILD style.

 WS_POPUPWINDOW   // 创建一个具有 WS-BORDER, WS_POPUP, WS_SYSMENU 风格的窗口
      // WS_CAPTION和WS_POPUPWINDOW风格必须相结合,使窗口菜单可见。
 Creates a pop-up window with WS_BORDER, WS_POPUP, and WS_SYSMENU styles.
 The WS_CAPTION and WS_POPUPWINDOW styles must be combined to make the window menu visible.

 WS_SIZEBOX    // 创建的窗口边框可以拖动, 类似于 WS-THICKFRAME 风格
 Creates a window that has a sizing border. Same as the WS_THICKFRAME style.

 WS_SYSMENU    // 创建一个具有系统菜单的窗口, WS_CAPTION 必须一起指定
 Creates a window that has a window menu on its title bar. The WS_CAPTION style must also be specified.

 WS_TABSTOP    // 指定控件可以接收由键盘输入的tab键, 切换
      
 Specifies a control that can receive the keyboard focus when the user presses the TAB key.
 Pressing the TAB key changes the keyboard focus to the next control with the WS_TABSTOP style.
 You can turn this style on and off to change dialog box navigation.
 To change this style after a window has been created, use SetWindowLong.


 WS_THICKFRAME   // 类似于 WS_SIZEBOX 风格
 Creates a window that has a sizing border. Same as the WS_SIZEBOX style.

 WS_TILED    // 创建一个层叠式窗口,有标题栏
 Creates an overlapped window. An overlapped window has a title bar and a border. Same as the WS_OVERLAPPED style.

 WS_TILEDWINDOW   // 创建一个带有 WS_OVERLAPPED, WS_CAPTION, WS_SYSMENU, WS_THICKFRAME, WS_MINIMIZEBOX, WS_MAXIMIZEBOX
      // 的层叠窗口
 Creates an overlapped window with the WS_OVERLAPPED, WS_CAPTION, WS_SYSMENU, WS_THICKFRAME, WS_MINIMIZEBOX,
 and WS_MAXIMIZEBOX styles. Same as the WS_OVERLAPPEDWINDOW style.

 WS_VISIBLE    // 创建的窗口可见
 Creates a window that is initially visible.
 This style can be turned on and off by using ShowWindow or SetWindowPos.


 WS_VSCROLL    // 创建的窗口具有垂直滚动条
 Creates a window that has a vertical scroll bar.


2. Extended Window Styles

 WS_EX_ACCEPTFILES    // 使其具有文件拖拽
  Specifies that a window created with this style accepts drag-and-drop files.

 WS_EX_APPWINDOW     // 当窗口可见时,将一个顶层窗口放置到任务条上
  Forces a top-level window onto the taskbar when the window is visible.

 WS_EX_CLIENTEDGE  // 使创建窗口具有3D风格(指定窗口有一个带阴影的边界)
  Specifies that a window has a 3D look — that is, a border with a sunken edge.

 WS_EX_CONTEXTHELP    // 帮助消息
  Includes a question mark in the title bar of the window. When the user clicks the question mark,
  the cursor changes to a question mark with a pointer. If the user then clicks a child window,
  the child receives a WM_HELP message.

 WS_EX_CONTROLPARENT    // 允许用户使用Tab键在窗口的子窗口间搜索
  Allows the user to navigate among the child windows of the window by using the TAB key.

 WS_EX_DLGMODALFRAME    // 创建一个带双边的窗口;该窗口可以在dwStyle中指定WS_CAPTION风格来创建一个标题栏。
  Designates a window with a double border that may (optionally) be created with a title bar when you specify the WS_CAPTION style flag in the dwStyle parameter.

 WS_EX_LEFT      // 窗口具有左对齐属性,这是缺省设置的。
  Gives window generic left-aligned properties. This is the default.

 WS_EX_LEFTSCROLLBAR    // 如果外壳语言是如Hebrew,Arabic,或其他支持reading order alignment的语言,
       // 则标题条(如果存在)则在客户区的左部分。若是其他语言,在该风格被忽略并且不作为错误处理。
  Places a vertical scroll bar to the left of the client area.

 WS_EX_LTRREADING     // 窗口文本以LEFT到RIGHT(自左向右)属性的顺序显示。这是缺省设置的。
  Displays the window text using left-to-right reading order properties. This is the default.

 WS_EX_MDICHILD     // 创建一个MDI子窗口。
  Creates an MDI child window.

 WS_EX_NOPARENTNOTIFY  
  Specifies that a child window created with this style will not send the WM_PARENTNOTIFY message
  to its parent window when the child window is created or destroyed.

 WS_EX_OVERLAPPEDWINDOW   // WS_EX_CLIENTEDGE和WS_EX_WINDOWEDGE的组合
  Combines the WS_EX_CLIENTEDGE and WS_EX_WINDOWEDGE styles

 WS_EX_PALETTEWINDOW    // WS_EX_WINDOWEDGE, WS_EX_TOOLWINDOW和WS_WX_TOPMOST风格的组合
  Combines the WS_EX_WINDOWEDGE and WS_EX_TOPMOST styles.

 WS_EX_RIGHT      // WS_EX_RIGHT:窗口具有普通的右对齐属性,
       // 这依赖于窗口类。只有在外壳语言是如Hebrew,Arabic或其他支持读顺序对齐(reading order alignment)
       // 的语言时该风格才有效,否则,忽略该标志并且不作为错误处理。
  Gives a window generic right-aligned properties. This depends on the window class.

 WS_EX_RIGHTSCROLLBAR   // 垂直滚动条在窗口的右边界。这是缺省设置的。
  Places a vertical scroll bar (if present) to the right of the client area. This is the default.

 WS_EX_RTLREADING     // 如果外壳语言是如Hebrew,Arabic,或其他支持读顺序对齐(reading order alignment)的语言,
       // 则窗口文本是一自左向右)RIGHT到LEFT顺序的读出顺序。若是其他语言,在该风格被忽略并且不作为错误处理。
  Displays the window text using right-to-left reading order properties.

 WS_EX_STATICEDGE     // 为不接受用户输入的项创建一个3一维边界风格
  Creates a window with a three-dimensional border style intended to be used for items that do not accept user input.

 WS_EX_TOOLWINDOW     // 创建工具窗口,即窗口是一个游动的工具条。工具窗口的标题条比一般窗口的标题条短,
       // 并且窗口标题以小字体显示。工具窗口不在任务栏里显示,当用户按下alt+Tab键时工具窗口不在对话框里显示。
       // 如果工具窗口有一个系统菜单,它的图标也不会显示在标题栏里,但是,可以通过点击鼠标右键或Alt+Space来显示菜单。
  Creates a tool window, which is a window intended to be used as a floating toolbar. A tool window has a title bar that is shorter than a normal title bar, and the window title is drawn using a smaller font. A tool window does not appear in the task bar or in the window that appears when the user presses ALT+TAB.

 WS_EX_TOPMOST     // 指明以该风格创建的窗口应放置在所有非最高层窗口的上面并且停留在其L,即使窗口未被激活。
       // 使用函数SetWindowPos来设置和移去这个风格。
  Specifies that a window created with this style should be placed above all nontopmost windows and stay above them even when the window is deactivated. An application can use the SetWindowPos member function to add or remove this attribute.

 WS_EX_TRANSPARENT    // 指定以这个风格创建的窗口在窗口下的同属窗口已重画时,该窗口才可以重画。
  Specifies that a window created with this style is to be transparent. That is, any windows that are beneath the window are not obscured by the window. A window created with this style receives WM_PAINT messages only after all sibling windows beneath it have been updated.

 WS_EX_WINDOWEDGE     // 指定一个窗口的边框具有凸起的边缘
  Specifies that a window has a border with a raised edge.

 

 

你可能感兴趣的:(窗口风格)