获取指定窗口窗口风格
2008-11-10 12:23
183 查看
API函数:LONG GetWindowLong(
HWND hWnd, // handle of window
int nIndex // offset of value to retrieve
);
设置nIndex:GWL_STYLE
然后,函数GetWindowLong函数的返回值和相应的参数做与运算,结果为1,则属于相应风格,反之则反。
窗口风格参数如下:
1. Style Meaning
2. WS_BORDER //Creates a window that has a thin-line border.
3. WS_CAPTION //Creates a window that has a title bar (includes the WS_BORDER style).
4. WS_CHILD //Creates a child window. This style cannot be used with the WS_POPUP style.
5. WS_CHILDWINDOW //Same as the WS_CHILD style.
6. 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.
7. 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.
8. WS_DISABLED //Creates a window that is initially disabled. A disabled window cannot receive input from the user.
9. 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.
10. WS_GROUP //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.
11. WS_HSCROLL //Creates a window that has a horizontal scroll bar.
12. WS_ICONIC //Creates a window that is initially minimized. Same as the WS_MINIMIZE style.
13. WS_MAXIMIZE //Creates a window that is initially maximized.
14. 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.
15. WS_MINIMIZE //Creates a window that is initially minimized. Same as the WS_ICONIC style.
16. 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.
17. WS_OVERLAPPED //Creates an overlapped window. An overlapped window has a title bar and a border. Same as the WS_TILED style.
18. WS_OVERLAPPEDWINDOW //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.
19. WS_POPUP //Creates a pop-up window. This style cannot be used with the WS_CHILD style.
20. 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.
21. WS_SIZEBOX //Creates a window that has a sizing border. Same as the WS_THICKFRAME style.
22. WS_SYSMENU //Creates a window that has a window-menu on its title bar. The WS_CAPTION style must also be specified.
23. WS_TABSTOP //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.
24. WS_THICKFRAME //Creates a window that has a sizing border. Same as the WS_SIZEBOX style.
25. WS_TILED //Creates an overlapped window. An overlapped window has a title bar and a border. Same as the WS_OVERLAPPED style.
26. 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_OVERLAPPEDWINDOW style.
27. WS_VISIBLE //Creates a window that is initially visible.
28. WS_VSCROLL //Creates a window that has a vertical scroll bar.
1. The following button styles (in the BUTTON class) can be specified in the dwStyle parameter:
2.
3. Style Meaning
4. BS_3STATE //Creates a button that is the same as a check box, except that the box can be grayed as well as checked or unchecked. Use the grayed state to show that the state of the check box is not determined.
5. BS_AUTO3STATE//Creates a button that is the same as a three-state check box, except that the box changes its state when the user selects it. The state cycles through checked, grayed, and unchecked.
6. BS_AUTOCHECKBOX //Creates a button that is the same as a check box, except that the check state automatically toggles between checked and unchecked each time the user selects the check box.
7. BS_AUTORADIOBUTTON //Creates a button that is the same as a radio button, except that when the user selects it, Windows automatically sets the button's check state to checked and automatically sets the check state for all other buttons in the same group to unchecked.
8. BS_CHECKBOX //Creates a small, empty check box with text. By default, the text is displayed to the right of the check box. To display the text to the left of the check box, combine this flag with the BS_LEFTTEXT style (or with the equivalent BS_RIGHTBUTTON style).
9. BS_DEFPUSHBUTTON //Creates a push button that behaves like a BS_PUSHBUTTON style button, but also has a heavy black border. If the button is in a dialog box, the user can select the button by pressing the ENTER key, even when the button does not have the input focus. This style is useful for enabling the user to quickly select the most likely (default) option.
10. BS_GROUPBOX //Creates a rectangle in which other controls can be grouped. Any text associated with this style is displayed in the rectangle's upper left corner.
11. BS_LEFTTEXT //Places text on the left side of the radio button or check box when combined with a radio button or check box style. Same as the BS_RIGHTBUTTON style.
12. BS_OWNERDRAW //Creates an owner-drawn button. The owner window receives a WM_MEASUREITEM message when the button is created and a WM_DRAWITEM message when a visual aspect of the button has changed. Do not combine the BS_OWNERDRAW style with any other button styles.
13. BS_PUSHBUTTON //Creates a push button that posts a WM_COMMAND message to the owner window when the user selects the button.
14. BS_RADIOBUTTON //Creates a small circle with text. By default, the text is displayed to the right of the circle. To display the text to the left of the circle, combine this flag with the BS_LEFTTEXT style (or with the equivalent BS_RIGHTBUTTON style). Use radio buttons for groups of related, but mutually exclusive choices.
15. BS_USERBUTTON //Obsolete, but provided for compatibility with 16-bit versions of Windows. Win32-based applications should use BS_OWNERDRAW instead.
16. BS_BITMAP //Specifies that the button displays a bitmap.
17. BS_BOTTOM //Places text at the bottom of the button rectangle.
18. BS_CENTER //Centers text horizontally in the button rectangle.
19. BS_ICON //Specifies that the button displays an icon.
20. BS_LEFT //Left-//justifies the text in the button rectangle. However, if the button is a check box or radio button that does not have the BS_RIGHTBUTTON style, the text is left justified on the right side of the check box or radio button.
21. BS_MULTILINE //Wraps the button text to multiple lines if the text string is too long to fit on a single line in the button rectangle.
22. BS_NOTIFY //Enables a button to send BN_DBLCLK, BN_KILLFOCUS, and BN_SETFOCUS notification messages to its parent window. Note that buttons send the BN_CLICKED notification message regardless of whether it has this style.
23. BS_PUSHLIKE //Makes a button (such as a check box, three-state check box, or radio button) look and act like a push button. The button looks raised when it isn't pushed or checked, and sunken when it is pushed or checked.
24. BS_RIGHT //Right-//justifies text in the button rectangle. However, if the button is a check box or radio button that does not have the BS_RIGHTBUTTON style, the text is right justified on the right side of the check box or radio button.
25. BS_RIGHTBUTTON //Positions a radio button's circle or a check box's square on the right side of the button rectangle. Same as the BS_LEFTTEXT style.
26. BS_TEXT //Specifies that the button displays text.
27. BS_TOP //Places text at the top of the button rectangle.
28. BS_VCENTER //Places text in the middle (vertically) of the button rectangle.
29.
30.
31. The following combo box styles (in the COMBOBOX class) can be specified in the dwStyle parameter:
32.
33. Style Meaning
34. CBS_AUTOHSCROLL //Automatically scrolls the text in an edit control to the right when the user types a character at the end of the line. If this style is not set, only text that fits within the rectangular boundary is allowed.
35. CBS_DISABLENOSCROLL //Shows a disabled vertical scroll bar in the list box when the box does not contain enough items to scroll. Without this style, the scroll bar is hidden when the list box does not contain enough items.
36. CBS_DROPDOWN //Similar to CBS_SIMPLE, except that the list box is not displayed unless the user selects an icon next to the edit control.
37. CBS_DROPDOWNLIST //Similar to CBS_DROPDOWN, except that the edit control is replaced by a static text item that displays the current selection in the list box.
38. CBS_HASSTRINGS //Specifies that an owner-drawn combo box contains items consisting of strings. The combo box maintains the memory and address for the strings, so the application can use the CB_GETLBTEXT message to retrieve the text for a particular item.
39. CBS_LOWERCASE //Converts to lowercase any uppercase characters entered into the edit control of a combo box.
40. CBS_NOINTEGRALHEIGHT //Specifies that the size of the combo box is exactly the size specified by the application when it created the combo box. Normally, Windows sizes a combo box so that it does not display partial items.
41. CBS_OEMCONVERT //Converts text entered in the combo box edit control. The text is converted from the Windows character set to the OEM character set and then back to the Windows set. This ensures proper character conversion when the application calls the CharToOem function to convert a Windows string in the combo box to OEM characters. This style is most useful for combo boxes that contain filenames and applies only to combo boxes created with the CBS_SIMPLE or CBS_DROPDOWN style.
42. CBS_OWNERDRAWFIXED //Specifies that the owner of the list box is responsible for drawing its contents and that the items in the list box are all the same height. The owner window receives a WM_MEASUREITEM message when the combo box is created and a WM_DRAWITEM message when a visual aspect of the combo box has changed.
43. CBS_OWNERDRAWVARIABLE //Specifies that the owner of the list box is responsible for drawing its contents and that the items in the list box are variable in height. The owner window receives a WM_MEASUREITEM message for each item in the combo box when you create the combo box; the owner window receives a WM_DRAWITEM message when a visual aspect of the combo box has changed.
44. CBS_SIMPLE //Displays the list box at all times. The current selection in the list box is displayed in the edit control.
45. CBS_SORT //Automatically sorts strings entered into the list box.
46. CBS_UPPERCASE //Converts to uppercase any lowercase characters entered into the edit control of a combo box.
47.
48.
49. The following edit control styles (in the EDIT class) can be specified in the dwStyle parameter:
50.
51. Style Meaning
52. ES_AUTOHSCROLL //Automatically scrolls text to the right by 10 characters when the user types a character at the end of the line. When the user presses the ENTER key, the control scrolls all text back to position zero.
53. ES_AUTOVSCROLL //Automatically scrolls text up one page when the user presses the ENTER key on the last line.
54. ES_CENTER //Centers text in a multiline edit control.
55. ES_LEFT Left-aligns text.
56. ES_LOWERCASE //Converts all characters to lowercase as they are typed into the edit control.
57. ES_MULTILINE //Designates a multiline edit control. The default is single-line edit control.
58. //When the multiline edit control is in a dialog box, the default response to pressing the ENTER key is to activate the default button. To use the ENTER key as a carriage return, use the ES_WANTRETURN style.
59. //When the multiline edit control is not in a dialog box and the ES_AUTOVSCROLL style is specified, the edit control shows as many lines as possible and scrolls vertically when the user presses the ENTER key. If you do not specify ES_AUTOVSCROLL, the edit control shows as many lines as possible and beeps if the user presses the ENTER key when no more lines can be displayed.
60. //If you specify the ES_AUTOHSCROLL style, the multiline edit control automatically scrolls horizontally when the caret goes past the right edge of the control. To start a new line, the user must press the ENTER key. If you do not specify ES_AUTOHSCROLL, the control automatically wraps words to the beginning of the next line when necessary. A new line is also started if the user presses the ENTER key. The window size determines the position of the word wrap. If the window size changes, the word wrapping position changes and the text is redisplayed.
61. //Multiline edit controls can have scroll bars. An edit control with scroll bars processes its own scroll bar messages. Note that edit controls without scroll bars scroll as described in the previous paragraphs and process any scroll messages sent by the parent window.
62. ES_NOHIDESEL //Negates the default behavior for an edit control. The default behavior hides the selection when the control loses the input focus and inverts the selection when the control receives the input focus. If you specify ES_NOHIDESEL, the selected text is inverted, even if the control does not have the focus.
63. ES_NUMBER //Allows only digits to be entered into the edit control.
64. ES_OEMCONVERT //Converts text entered in the edit control. The text is converted from the Windows character set to the OEM character set and then back to the Windows set. This ensures proper character conversion when the application calls the CharToOem function to convert a Windows string in the edit control to OEM characters. This style is most useful for edit controls that contain filenames.
65. ES_PASSWORD Displays an asterisk (*) for each character typed into the edit control. You can use the EM_SETPASSWORDCHAR message to change the character that is displayed.
66. ES_READONLY Prevents the user from typing or editing text in the edit control.
67. ES_RIGHT Right-aligns text in a multiline edit control.
68. ES_UPPERCASE Converts all characters to uppercase as they are typed into the edit control.
69. ES_WANTRETURN Specifies that a carriage return be inserted when the user presses the ENTER key while entering text into a multiline edit control in a dialog box. If you do not specify this style, pressing the ENTER key has the same effect as pressing the dialog box's default push button. This style has no effect on a single-line edit control.
70.
71.
72. The following list box control styles (in the LISTBOX class) can be specified in the dwStyle parameter:
73.
74. Style Meaning
75. LBS_DISABLENOSCROLL Shows a disabled vertical scroll bar for the list box when the box does not contain enough items to scroll. If you do not specify this style, the scroll bar is hidden when the list box does not contain enough items.
76. LBS_EXTENDEDSEL Allows multiple items to be selected by using the SHIFT key and the mouse or special key combinations.
77. LBS_HASSTRINGS Specifies that a list box contains items consisting of strings. The list box maintains the memory and addresses for the strings so the application can use the LB_GETTEXT message to retrieve the text for a particular item. By default, all list boxes except owner-drawn list boxes have this style. You can create an owner-drawn list box either with or without this style.
78. LBS_MULTICOLUMN Specifies a multicolumn list box that is scrolled horizontally. The LB_SETCOLUMNWIDTH message sets the width of the columns.
79. LBS_MULTIPLESEL Turns string selection on or off each time the user clicks or double-clicks a string in the list box. The user can select any number of strings.
80. LBS_NODATA Specifies a no-data list box. Specify this style when the count of items in the list box will exceed one thousand. A no-data list box must also have the LBS_OWNERDRAWFIXED style, but must not have the LBS_SORT or LBS_HASSTRINGS style.
81. A no-data list box resembles an owner-drawn list box except that it contains no string or bitmap data for an item. Commands to add, insert, or delete an item always ignore any given item data; requests to find a string within the list box always fail. Windows sends the WM_DRAWITEM message to the owner window when an item must be drawn. The itemID member of the DRAWITEMSTRUCT structure passed with the WM_DRAWITEM message specifies the line number of the item to be drawn. A no-data list box does not send a WM_DELETEITEM message.
82. LBS_NOINTEGRALHEIGHT Specifies that the size of the list box is exactly the size specified by the application when it created the list box. Normally, Windows sizes a list box so that the list box does not display partial items.
83. LBS_NOREDRAW Specifies that the list box's appearance is not updated when changes are made. You can change this style at any time by sending a WM_SETREDRAW message.
84. LBS_NOSEL Specifies that the list box contains items that can be viewed but not selected.
85. LBS_NOTIFY Notifies the parent window with an input message whenever the user clicks or double-clicks a string in the list box.
86. LBS_OWNERDRAWFIXED Specifies that the owner of the list box is responsible for drawing its contents and that the items in the list box are the same height. The owner window receives a WM_MEASUREITEM message when the list box is created and a WM_DRAWITEM message when a visual aspect of the list box has changed.
87. LBS_OWNERDRAWVARIABLE Specifies that the owner of the list box is responsible for drawing its contents and that the items in the list box are variable in height. The owner window receives a WM_MEASUREITEM message for each item in the combo box when the combo box is created and a WM_DRAWITEM message when a visual aspect of the combo box has changed.
88. LBS_SORT Sorts strings in the list box alphabetically.
89. LBS_STANDARD Sorts strings in the list box alphabetically. The parent window receives an input message whenever the user clicks or double-clicks a string. The list box has borders on all sides.
90. LBS_USETABSTOPS Enables a list box to recognize and expand tab characters when drawing its strings. The default tab positions are 32 dialog box units. A dialog box unit is a horizontal or vertical distance. One horizontal dialog box unit is equal to one-fourth of the current dialog box base-width unit. Windows calculates these units based on the height and width of the current system font. The GetDialogBaseUnits function returns the current dialog box base units in pixels.
91. LBS_WANTKEYBOARDINPUT Specifies that the owner of the list box receives WM_VKEYTOITEM messages whenever the user presses a key and the list box has the input focus. This enables an application to perform special processing on the keyboard input.
92.
93.
94. The following scroll bar styles (in the SCROLLBAR class) can be specified in the dwStyle parameter:
95.
96. Style Meaning
97. SBS_BOTTOMALIGN Aligns the bottom edge of the scroll bar with the bottom edge of the rectangle defined by the parameters x, y, nWidth, and nHeight. The scroll bar has the default height for system scroll bars. Use this style with the SBS_HORZ style.
98. SBS_HORZ Designates a horizontal scroll bar. If neither the SBS_BOTTOMALIGN nor SBS_TOPALIGN style is specified, the scroll bar has the height, width, and position defined by x, y, nWidth, and nHeight.
99. SBS_LEFTALIGN Aligns the left edge of the scroll bar with the left edge of the rectangle defined by the parameters x, y, nWidth, and nHeight. The scroll bar has the default width for system scroll bars. Use this style with the SBS_VERT style.
100. SBS_RIGHTALIGN Aligns the right edge of the scroll bar with the right edge of the rectangle defined by the parameters x, y, nWidth, and nHeight. The scroll bar has the default width for system scroll bars. Use this style with the SBS_VERT style.
101. SBS_SIZEBOX Designates a size box. If you specify neither the SBS_SIZEBOXBOTTOMRIGHTALIGN nor the SBS_SIZEBOXTOPLEFTALIGN style, the size box has the height, width, and position specified by the parameters x, y, nWidth, and nHeight.
102. SBS_SIZEBOXBOTTOMRIGHTALIGN Aligns the lower-right corner of the size box with the lower-right corner of the rectangle specified by the parameters x, y, nWidth, and nHeight. The size box has the default size for system size boxes. Use this style with the SBS_SIZEBOX style.
103. SBS_SIZEBOXTOPLEFTALIGN Aligns the upper-left corner of the size box with the upper-left corner of the rectangle specified by the parameters x, y, nWidth, and nHeight. The size box has the default size for system size boxes. Use this style with the SBS_SIZEBOX style.
104. SBS_SIZEGRIP Same as SBS_SIZEBOX, but with a raised edge.
105. SBS_TOPALIGN Aligns the top edge of the scroll bar with the top edge of the rectangle defined by the parameters x, y, nWidth, and nHeight. The scroll bar has the default height for system scroll bars. Use this style with the SBS_HORZ style.
106. SBS_VERT Designates a vertical scroll bar. If you specify neither the SBS_RIGHTALIGN nor the SBS_LEFTALIGN style, the scroll bar has the height, width, and position specified by the parameters x, y, nWidth, and nHeight.
107.
108.
109. The following static control styles (in the STATIC class) can be specified in the dwStyle parameter. A static control can have only one of these styles:
110.
111. Style Description
112. SS_BITMAP Specifies a bitmap is to be displayed in the static control. The error code text is the name of a bitmap (not a filename) defined elsewhere in the resource file. The style ignores the nWidth and nHeight parameters; the control automatically sizes itself to accommodate the bitmap.
113. SS_BLACKFRAME Specifies a box with a frame drawn in the same color as the window frames. This color is black in the default Windows color scheme.
114. SS_BLACKRECT Specifies a rectangle filled with the current window frame color. This color is black in the default Windows color scheme.
115. SS_CENTER Specifies a simple rectangle and centers the error code text in the rectangle. The text is formatted before it is displayed. Words that extend past the end of a line are automatically wrapped to the beginning of the next centered line.
116. SS_CENTERIMAGE Specifies that the midpoint of a static control with the SS_BITMAP or SS_ICON style is to remain fixed when the control is resized. The four sides are adjusted to accommodate a new bitmap or icon.If a static control has the SS_BITMAP style and the bitmap is smaller than the control's client area, the client area is filled with the color of the pixel in the upper-left corner of the bitmap. If a static control has the SS_ICON style, the icon does not appear to paint the client area.
117. SS_GRAYFRAME Specifies a box with a frame drawn with the same color as the screen background (desktop). This color is gray in the default Windows color scheme.
118. SS_GRAYRECT Specifies a rectangle filled with the current screen background color. This color is gray in the default Windows color scheme.
119. SS_ICON Specifies an icon displayed in the dialog box. The given text is the name of an icon (not a filename) defined elsewhere in the resource file. The style ignores the nWidth and nHeight parameters; the icon automatically sizes itself.
120. SS_LEFT Specifies a simple rectangle and left-aligns the given text in the rectangle. The text is formatted before it is displayed. Words that extend past the end of a line are automatically wrapped to the beginning of the next left-aligned line.
121. SS_LEFTNOWORDWRAP Specifies a simple rectangle and left-aligns the given text in the rectangle. Tabs are expanded but words are not wrapped. Text that extends past the end of a line is clipped.
122. SS_METAPICT Specifies a metafile picture is to be displayed in the static control. The given text is the name of a metafile picture (not a filename) defined elsewhere in the resource file. A metafile static control has a fixed size; the metafile picture is scaled to fit the static control's client area.
123. SS_NOPREFIX Prevents interpretation of any ampersand (&) characters in the control's text as accelerator prefix characters. These are displayed with the ampersand removed and the next character in the string underlined. This static control style may be included with any of the defined static controls.
124. An application can combine SS_NOPREFIX with other styles by using the bitwise OR (|) operator. This can be useful when filenames or other strings that may contain an ampersand (&) must be displayed in a static control in a dialog box.
125. SS_NOTIFY Sends the parent window STN_CLICKED and STN_DBLCLK notification messages when the user clicks or double clicks the control.
126. SS_RIGHT Specifies a simple rectangle and right-aligns the given text in the rectangle. The text is formatted before it is displayed. Words that extend past the end of a line are automatically wrapped to the beginning of the next right-aligned line.
127. SS_RIGHTIMAGE Specifies that the bottom-right corner of a static control with the SS_BITMAP or SS_ICON style is to remain fixed when the control is resized. Only the top and left sides are adjusted to accommodate a new bitmap or icon.
128. SS_SIMPLE Specifies a simple rectangle and displays a single line of left-aligned text in the rectangle. The text line cannot be shortened or altered in any way. The control's parent window or dialog box must not process the WM_CTLCOLORSTATIC message.
129. SS_WHITEFRAME Specifies a box with a frame drawn with the same color as the window backgrounds. This color is white in the default Windows color scheme.
130. SS_WHITERECT Specifies a rectangle filled with the current window background color. This color is white in the default Windows color scheme.
131.
132.
133. The following dialog box styles can be specified in the dwStyle parameter:
134.
135. Style Meaning
136. DS_3DLOOK Gives the dialog box a nonbold font and draws three-dimensional borders around control windows in the dialog box.The DS_3DLOOK style is required only by Win32-based applications compiled for versions of Windows earlier than Windows 95 or Windows NT 4.0. The system automatically applies the three-dimensional look to dialog boxes created by applications compiled for current versions of Windows.
137. DS_ABSALIGN Indicates that the coordinates of the dialog box are screen coordinates; otherwise, Windows assumes they are client coordinates.
138. DS_CENTER Centers the dialog box in the working area; that is, the area not obscured by the tray.
139. DS_CENTERMOUSE Centers the mouse cursor in the dialog box.
140. DS_CONTEXTHELP Includes a question mark in the title bar of the dialog box. When the user clicks the question mark, the cursor changes to a question mark with a pointer. If the user then clicks a control in the dialog box, the control receives a WM_HELP message. The control should pass the message to the dialog procedure, which should call the WinHelp function using the HELP_WM_HELP command. The Help application displays a pop-up window that typically contains help for the control.Note that DS_CONTEXTHELP is just a placeholder. When the dialog box is created, the system checks for DS_CONTEXTHELP and, if it is there, adds WS_EX_CONTEXTHELP to the extended style of the dialog box. WS_EX_CONTEXTHELP cannot be used with the WS_MAXIMIZEBOX or WS_MINIMIZEBOX styles.
141. DS_CONTROL Creates a dialog box that works well as a child window of another dialog box, much like a page in a property sheet. This style allows the user to tab among the control windows of a child dialog box, use its accelerator keys, and so on.
142. DS_FIXEDSYS Use SYSTEM_FIXED_FONT instead of SYSTEM_FONT.
143. DS_LOCALEDIT Applies to 16-bit applications only. This style directs edit controls in the dialog box to allocate memory from the application's data segment. Otherwise, edit controls allocate storage from a global memory object.
144. DS_MODALFRAME Creates a dialog box with a modal dialog-box frame that can be combined with a title bar and window menu by specifying the WS_CAPTION and WS_SYSMENU styles.
145. DS_NOFAILCREATE Creates the dialog box even if errors occur ?for example, if a child window cannot be created or if the system cannot create a special data segment for an edit control.
146. DS_NOIDLEMSG Suppresses WM_ENTERIDLE messages that Windows would otherwise send to the owner of the dialog box while the dialog box is displayed.
147. DS_RECURSE Dialog box style for control-like dialog boxes.
148. DS_SETFONT Indicates that the dialog box template (the DLGTEMPLATE structure) contains two additional members specifying a font name and point size. The corresponding font is used to display text within the dialog box client area and within the dialog box controls. Windows passes the handle of the font to the dialog box and to each control by sending them the WM_SETFONT message.
149. DS_SETFOREGROUND Does not apply to 16-bit versions of Microsoft Windows. This style brings the dialog box to the foreground. Internally, Windows calls the SetForegroundWindow function for the dialog box.
150. DS_SYSMODAL Creates a system-modal dialog box. This style causes the dialog box to have the WS_EX_TOPMOST style, but otherwise has no effect on the dialog box or the behavior of other windows in the system when the dialog box is displayed.
HWND hWnd, // handle of window
int nIndex // offset of value to retrieve
);
设置nIndex:GWL_STYLE
然后,函数GetWindowLong函数的返回值和相应的参数做与运算,结果为1,则属于相应风格,反之则反。
窗口风格参数如下:
1. Style Meaning
2. WS_BORDER //Creates a window that has a thin-line border.
3. WS_CAPTION //Creates a window that has a title bar (includes the WS_BORDER style).
4. WS_CHILD //Creates a child window. This style cannot be used with the WS_POPUP style.
5. WS_CHILDWINDOW //Same as the WS_CHILD style.
6. 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.
7. 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.
8. WS_DISABLED //Creates a window that is initially disabled. A disabled window cannot receive input from the user.
9. 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.
10. WS_GROUP //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.
11. WS_HSCROLL //Creates a window that has a horizontal scroll bar.
12. WS_ICONIC //Creates a window that is initially minimized. Same as the WS_MINIMIZE style.
13. WS_MAXIMIZE //Creates a window that is initially maximized.
14. 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.
15. WS_MINIMIZE //Creates a window that is initially minimized. Same as the WS_ICONIC style.
16. 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.
17. WS_OVERLAPPED //Creates an overlapped window. An overlapped window has a title bar and a border. Same as the WS_TILED style.
18. WS_OVERLAPPEDWINDOW //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.
19. WS_POPUP //Creates a pop-up window. This style cannot be used with the WS_CHILD style.
20. 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.
21. WS_SIZEBOX //Creates a window that has a sizing border. Same as the WS_THICKFRAME style.
22. WS_SYSMENU //Creates a window that has a window-menu on its title bar. The WS_CAPTION style must also be specified.
23. WS_TABSTOP //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.
24. WS_THICKFRAME //Creates a window that has a sizing border. Same as the WS_SIZEBOX style.
25. WS_TILED //Creates an overlapped window. An overlapped window has a title bar and a border. Same as the WS_OVERLAPPED style.
26. 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_OVERLAPPEDWINDOW style.
27. WS_VISIBLE //Creates a window that is initially visible.
28. WS_VSCROLL //Creates a window that has a vertical scroll bar.
1. The following button styles (in the BUTTON class) can be specified in the dwStyle parameter:
2.
3. Style Meaning
4. BS_3STATE //Creates a button that is the same as a check box, except that the box can be grayed as well as checked or unchecked. Use the grayed state to show that the state of the check box is not determined.
5. BS_AUTO3STATE//Creates a button that is the same as a three-state check box, except that the box changes its state when the user selects it. The state cycles through checked, grayed, and unchecked.
6. BS_AUTOCHECKBOX //Creates a button that is the same as a check box, except that the check state automatically toggles between checked and unchecked each time the user selects the check box.
7. BS_AUTORADIOBUTTON //Creates a button that is the same as a radio button, except that when the user selects it, Windows automatically sets the button's check state to checked and automatically sets the check state for all other buttons in the same group to unchecked.
8. BS_CHECKBOX //Creates a small, empty check box with text. By default, the text is displayed to the right of the check box. To display the text to the left of the check box, combine this flag with the BS_LEFTTEXT style (or with the equivalent BS_RIGHTBUTTON style).
9. BS_DEFPUSHBUTTON //Creates a push button that behaves like a BS_PUSHBUTTON style button, but also has a heavy black border. If the button is in a dialog box, the user can select the button by pressing the ENTER key, even when the button does not have the input focus. This style is useful for enabling the user to quickly select the most likely (default) option.
10. BS_GROUPBOX //Creates a rectangle in which other controls can be grouped. Any text associated with this style is displayed in the rectangle's upper left corner.
11. BS_LEFTTEXT //Places text on the left side of the radio button or check box when combined with a radio button or check box style. Same as the BS_RIGHTBUTTON style.
12. BS_OWNERDRAW //Creates an owner-drawn button. The owner window receives a WM_MEASUREITEM message when the button is created and a WM_DRAWITEM message when a visual aspect of the button has changed. Do not combine the BS_OWNERDRAW style with any other button styles.
13. BS_PUSHBUTTON //Creates a push button that posts a WM_COMMAND message to the owner window when the user selects the button.
14. BS_RADIOBUTTON //Creates a small circle with text. By default, the text is displayed to the right of the circle. To display the text to the left of the circle, combine this flag with the BS_LEFTTEXT style (or with the equivalent BS_RIGHTBUTTON style). Use radio buttons for groups of related, but mutually exclusive choices.
15. BS_USERBUTTON //Obsolete, but provided for compatibility with 16-bit versions of Windows. Win32-based applications should use BS_OWNERDRAW instead.
16. BS_BITMAP //Specifies that the button displays a bitmap.
17. BS_BOTTOM //Places text at the bottom of the button rectangle.
18. BS_CENTER //Centers text horizontally in the button rectangle.
19. BS_ICON //Specifies that the button displays an icon.
20. BS_LEFT //Left-//justifies the text in the button rectangle. However, if the button is a check box or radio button that does not have the BS_RIGHTBUTTON style, the text is left justified on the right side of the check box or radio button.
21. BS_MULTILINE //Wraps the button text to multiple lines if the text string is too long to fit on a single line in the button rectangle.
22. BS_NOTIFY //Enables a button to send BN_DBLCLK, BN_KILLFOCUS, and BN_SETFOCUS notification messages to its parent window. Note that buttons send the BN_CLICKED notification message regardless of whether it has this style.
23. BS_PUSHLIKE //Makes a button (such as a check box, three-state check box, or radio button) look and act like a push button. The button looks raised when it isn't pushed or checked, and sunken when it is pushed or checked.
24. BS_RIGHT //Right-//justifies text in the button rectangle. However, if the button is a check box or radio button that does not have the BS_RIGHTBUTTON style, the text is right justified on the right side of the check box or radio button.
25. BS_RIGHTBUTTON //Positions a radio button's circle or a check box's square on the right side of the button rectangle. Same as the BS_LEFTTEXT style.
26. BS_TEXT //Specifies that the button displays text.
27. BS_TOP //Places text at the top of the button rectangle.
28. BS_VCENTER //Places text in the middle (vertically) of the button rectangle.
29.
30.
31. The following combo box styles (in the COMBOBOX class) can be specified in the dwStyle parameter:
32.
33. Style Meaning
34. CBS_AUTOHSCROLL //Automatically scrolls the text in an edit control to the right when the user types a character at the end of the line. If this style is not set, only text that fits within the rectangular boundary is allowed.
35. CBS_DISABLENOSCROLL //Shows a disabled vertical scroll bar in the list box when the box does not contain enough items to scroll. Without this style, the scroll bar is hidden when the list box does not contain enough items.
36. CBS_DROPDOWN //Similar to CBS_SIMPLE, except that the list box is not displayed unless the user selects an icon next to the edit control.
37. CBS_DROPDOWNLIST //Similar to CBS_DROPDOWN, except that the edit control is replaced by a static text item that displays the current selection in the list box.
38. CBS_HASSTRINGS //Specifies that an owner-drawn combo box contains items consisting of strings. The combo box maintains the memory and address for the strings, so the application can use the CB_GETLBTEXT message to retrieve the text for a particular item.
39. CBS_LOWERCASE //Converts to lowercase any uppercase characters entered into the edit control of a combo box.
40. CBS_NOINTEGRALHEIGHT //Specifies that the size of the combo box is exactly the size specified by the application when it created the combo box. Normally, Windows sizes a combo box so that it does not display partial items.
41. CBS_OEMCONVERT //Converts text entered in the combo box edit control. The text is converted from the Windows character set to the OEM character set and then back to the Windows set. This ensures proper character conversion when the application calls the CharToOem function to convert a Windows string in the combo box to OEM characters. This style is most useful for combo boxes that contain filenames and applies only to combo boxes created with the CBS_SIMPLE or CBS_DROPDOWN style.
42. CBS_OWNERDRAWFIXED //Specifies that the owner of the list box is responsible for drawing its contents and that the items in the list box are all the same height. The owner window receives a WM_MEASUREITEM message when the combo box is created and a WM_DRAWITEM message when a visual aspect of the combo box has changed.
43. CBS_OWNERDRAWVARIABLE //Specifies that the owner of the list box is responsible for drawing its contents and that the items in the list box are variable in height. The owner window receives a WM_MEASUREITEM message for each item in the combo box when you create the combo box; the owner window receives a WM_DRAWITEM message when a visual aspect of the combo box has changed.
44. CBS_SIMPLE //Displays the list box at all times. The current selection in the list box is displayed in the edit control.
45. CBS_SORT //Automatically sorts strings entered into the list box.
46. CBS_UPPERCASE //Converts to uppercase any lowercase characters entered into the edit control of a combo box.
47.
48.
49. The following edit control styles (in the EDIT class) can be specified in the dwStyle parameter:
50.
51. Style Meaning
52. ES_AUTOHSCROLL //Automatically scrolls text to the right by 10 characters when the user types a character at the end of the line. When the user presses the ENTER key, the control scrolls all text back to position zero.
53. ES_AUTOVSCROLL //Automatically scrolls text up one page when the user presses the ENTER key on the last line.
54. ES_CENTER //Centers text in a multiline edit control.
55. ES_LEFT Left-aligns text.
56. ES_LOWERCASE //Converts all characters to lowercase as they are typed into the edit control.
57. ES_MULTILINE //Designates a multiline edit control. The default is single-line edit control.
58. //When the multiline edit control is in a dialog box, the default response to pressing the ENTER key is to activate the default button. To use the ENTER key as a carriage return, use the ES_WANTRETURN style.
59. //When the multiline edit control is not in a dialog box and the ES_AUTOVSCROLL style is specified, the edit control shows as many lines as possible and scrolls vertically when the user presses the ENTER key. If you do not specify ES_AUTOVSCROLL, the edit control shows as many lines as possible and beeps if the user presses the ENTER key when no more lines can be displayed.
60. //If you specify the ES_AUTOHSCROLL style, the multiline edit control automatically scrolls horizontally when the caret goes past the right edge of the control. To start a new line, the user must press the ENTER key. If you do not specify ES_AUTOHSCROLL, the control automatically wraps words to the beginning of the next line when necessary. A new line is also started if the user presses the ENTER key. The window size determines the position of the word wrap. If the window size changes, the word wrapping position changes and the text is redisplayed.
61. //Multiline edit controls can have scroll bars. An edit control with scroll bars processes its own scroll bar messages. Note that edit controls without scroll bars scroll as described in the previous paragraphs and process any scroll messages sent by the parent window.
62. ES_NOHIDESEL //Negates the default behavior for an edit control. The default behavior hides the selection when the control loses the input focus and inverts the selection when the control receives the input focus. If you specify ES_NOHIDESEL, the selected text is inverted, even if the control does not have the focus.
63. ES_NUMBER //Allows only digits to be entered into the edit control.
64. ES_OEMCONVERT //Converts text entered in the edit control. The text is converted from the Windows character set to the OEM character set and then back to the Windows set. This ensures proper character conversion when the application calls the CharToOem function to convert a Windows string in the edit control to OEM characters. This style is most useful for edit controls that contain filenames.
65. ES_PASSWORD Displays an asterisk (*) for each character typed into the edit control. You can use the EM_SETPASSWORDCHAR message to change the character that is displayed.
66. ES_READONLY Prevents the user from typing or editing text in the edit control.
67. ES_RIGHT Right-aligns text in a multiline edit control.
68. ES_UPPERCASE Converts all characters to uppercase as they are typed into the edit control.
69. ES_WANTRETURN Specifies that a carriage return be inserted when the user presses the ENTER key while entering text into a multiline edit control in a dialog box. If you do not specify this style, pressing the ENTER key has the same effect as pressing the dialog box's default push button. This style has no effect on a single-line edit control.
70.
71.
72. The following list box control styles (in the LISTBOX class) can be specified in the dwStyle parameter:
73.
74. Style Meaning
75. LBS_DISABLENOSCROLL Shows a disabled vertical scroll bar for the list box when the box does not contain enough items to scroll. If you do not specify this style, the scroll bar is hidden when the list box does not contain enough items.
76. LBS_EXTENDEDSEL Allows multiple items to be selected by using the SHIFT key and the mouse or special key combinations.
77. LBS_HASSTRINGS Specifies that a list box contains items consisting of strings. The list box maintains the memory and addresses for the strings so the application can use the LB_GETTEXT message to retrieve the text for a particular item. By default, all list boxes except owner-drawn list boxes have this style. You can create an owner-drawn list box either with or without this style.
78. LBS_MULTICOLUMN Specifies a multicolumn list box that is scrolled horizontally. The LB_SETCOLUMNWIDTH message sets the width of the columns.
79. LBS_MULTIPLESEL Turns string selection on or off each time the user clicks or double-clicks a string in the list box. The user can select any number of strings.
80. LBS_NODATA Specifies a no-data list box. Specify this style when the count of items in the list box will exceed one thousand. A no-data list box must also have the LBS_OWNERDRAWFIXED style, but must not have the LBS_SORT or LBS_HASSTRINGS style.
81. A no-data list box resembles an owner-drawn list box except that it contains no string or bitmap data for an item. Commands to add, insert, or delete an item always ignore any given item data; requests to find a string within the list box always fail. Windows sends the WM_DRAWITEM message to the owner window when an item must be drawn. The itemID member of the DRAWITEMSTRUCT structure passed with the WM_DRAWITEM message specifies the line number of the item to be drawn. A no-data list box does not send a WM_DELETEITEM message.
82. LBS_NOINTEGRALHEIGHT Specifies that the size of the list box is exactly the size specified by the application when it created the list box. Normally, Windows sizes a list box so that the list box does not display partial items.
83. LBS_NOREDRAW Specifies that the list box's appearance is not updated when changes are made. You can change this style at any time by sending a WM_SETREDRAW message.
84. LBS_NOSEL Specifies that the list box contains items that can be viewed but not selected.
85. LBS_NOTIFY Notifies the parent window with an input message whenever the user clicks or double-clicks a string in the list box.
86. LBS_OWNERDRAWFIXED Specifies that the owner of the list box is responsible for drawing its contents and that the items in the list box are the same height. The owner window receives a WM_MEASUREITEM message when the list box is created and a WM_DRAWITEM message when a visual aspect of the list box has changed.
87. LBS_OWNERDRAWVARIABLE Specifies that the owner of the list box is responsible for drawing its contents and that the items in the list box are variable in height. The owner window receives a WM_MEASUREITEM message for each item in the combo box when the combo box is created and a WM_DRAWITEM message when a visual aspect of the combo box has changed.
88. LBS_SORT Sorts strings in the list box alphabetically.
89. LBS_STANDARD Sorts strings in the list box alphabetically. The parent window receives an input message whenever the user clicks or double-clicks a string. The list box has borders on all sides.
90. LBS_USETABSTOPS Enables a list box to recognize and expand tab characters when drawing its strings. The default tab positions are 32 dialog box units. A dialog box unit is a horizontal or vertical distance. One horizontal dialog box unit is equal to one-fourth of the current dialog box base-width unit. Windows calculates these units based on the height and width of the current system font. The GetDialogBaseUnits function returns the current dialog box base units in pixels.
91. LBS_WANTKEYBOARDINPUT Specifies that the owner of the list box receives WM_VKEYTOITEM messages whenever the user presses a key and the list box has the input focus. This enables an application to perform special processing on the keyboard input.
92.
93.
94. The following scroll bar styles (in the SCROLLBAR class) can be specified in the dwStyle parameter:
95.
96. Style Meaning
97. SBS_BOTTOMALIGN Aligns the bottom edge of the scroll bar with the bottom edge of the rectangle defined by the parameters x, y, nWidth, and nHeight. The scroll bar has the default height for system scroll bars. Use this style with the SBS_HORZ style.
98. SBS_HORZ Designates a horizontal scroll bar. If neither the SBS_BOTTOMALIGN nor SBS_TOPALIGN style is specified, the scroll bar has the height, width, and position defined by x, y, nWidth, and nHeight.
99. SBS_LEFTALIGN Aligns the left edge of the scroll bar with the left edge of the rectangle defined by the parameters x, y, nWidth, and nHeight. The scroll bar has the default width for system scroll bars. Use this style with the SBS_VERT style.
100. SBS_RIGHTALIGN Aligns the right edge of the scroll bar with the right edge of the rectangle defined by the parameters x, y, nWidth, and nHeight. The scroll bar has the default width for system scroll bars. Use this style with the SBS_VERT style.
101. SBS_SIZEBOX Designates a size box. If you specify neither the SBS_SIZEBOXBOTTOMRIGHTALIGN nor the SBS_SIZEBOXTOPLEFTALIGN style, the size box has the height, width, and position specified by the parameters x, y, nWidth, and nHeight.
102. SBS_SIZEBOXBOTTOMRIGHTALIGN Aligns the lower-right corner of the size box with the lower-right corner of the rectangle specified by the parameters x, y, nWidth, and nHeight. The size box has the default size for system size boxes. Use this style with the SBS_SIZEBOX style.
103. SBS_SIZEBOXTOPLEFTALIGN Aligns the upper-left corner of the size box with the upper-left corner of the rectangle specified by the parameters x, y, nWidth, and nHeight. The size box has the default size for system size boxes. Use this style with the SBS_SIZEBOX style.
104. SBS_SIZEGRIP Same as SBS_SIZEBOX, but with a raised edge.
105. SBS_TOPALIGN Aligns the top edge of the scroll bar with the top edge of the rectangle defined by the parameters x, y, nWidth, and nHeight. The scroll bar has the default height for system scroll bars. Use this style with the SBS_HORZ style.
106. SBS_VERT Designates a vertical scroll bar. If you specify neither the SBS_RIGHTALIGN nor the SBS_LEFTALIGN style, the scroll bar has the height, width, and position specified by the parameters x, y, nWidth, and nHeight.
107.
108.
109. The following static control styles (in the STATIC class) can be specified in the dwStyle parameter. A static control can have only one of these styles:
110.
111. Style Description
112. SS_BITMAP Specifies a bitmap is to be displayed in the static control. The error code text is the name of a bitmap (not a filename) defined elsewhere in the resource file. The style ignores the nWidth and nHeight parameters; the control automatically sizes itself to accommodate the bitmap.
113. SS_BLACKFRAME Specifies a box with a frame drawn in the same color as the window frames. This color is black in the default Windows color scheme.
114. SS_BLACKRECT Specifies a rectangle filled with the current window frame color. This color is black in the default Windows color scheme.
115. SS_CENTER Specifies a simple rectangle and centers the error code text in the rectangle. The text is formatted before it is displayed. Words that extend past the end of a line are automatically wrapped to the beginning of the next centered line.
116. SS_CENTERIMAGE Specifies that the midpoint of a static control with the SS_BITMAP or SS_ICON style is to remain fixed when the control is resized. The four sides are adjusted to accommodate a new bitmap or icon.If a static control has the SS_BITMAP style and the bitmap is smaller than the control's client area, the client area is filled with the color of the pixel in the upper-left corner of the bitmap. If a static control has the SS_ICON style, the icon does not appear to paint the client area.
117. SS_GRAYFRAME Specifies a box with a frame drawn with the same color as the screen background (desktop). This color is gray in the default Windows color scheme.
118. SS_GRAYRECT Specifies a rectangle filled with the current screen background color. This color is gray in the default Windows color scheme.
119. SS_ICON Specifies an icon displayed in the dialog box. The given text is the name of an icon (not a filename) defined elsewhere in the resource file. The style ignores the nWidth and nHeight parameters; the icon automatically sizes itself.
120. SS_LEFT Specifies a simple rectangle and left-aligns the given text in the rectangle. The text is formatted before it is displayed. Words that extend past the end of a line are automatically wrapped to the beginning of the next left-aligned line.
121. SS_LEFTNOWORDWRAP Specifies a simple rectangle and left-aligns the given text in the rectangle. Tabs are expanded but words are not wrapped. Text that extends past the end of a line is clipped.
122. SS_METAPICT Specifies a metafile picture is to be displayed in the static control. The given text is the name of a metafile picture (not a filename) defined elsewhere in the resource file. A metafile static control has a fixed size; the metafile picture is scaled to fit the static control's client area.
123. SS_NOPREFIX Prevents interpretation of any ampersand (&) characters in the control's text as accelerator prefix characters. These are displayed with the ampersand removed and the next character in the string underlined. This static control style may be included with any of the defined static controls.
124. An application can combine SS_NOPREFIX with other styles by using the bitwise OR (|) operator. This can be useful when filenames or other strings that may contain an ampersand (&) must be displayed in a static control in a dialog box.
125. SS_NOTIFY Sends the parent window STN_CLICKED and STN_DBLCLK notification messages when the user clicks or double clicks the control.
126. SS_RIGHT Specifies a simple rectangle and right-aligns the given text in the rectangle. The text is formatted before it is displayed. Words that extend past the end of a line are automatically wrapped to the beginning of the next right-aligned line.
127. SS_RIGHTIMAGE Specifies that the bottom-right corner of a static control with the SS_BITMAP or SS_ICON style is to remain fixed when the control is resized. Only the top and left sides are adjusted to accommodate a new bitmap or icon.
128. SS_SIMPLE Specifies a simple rectangle and displays a single line of left-aligned text in the rectangle. The text line cannot be shortened or altered in any way. The control's parent window or dialog box must not process the WM_CTLCOLORSTATIC message.
129. SS_WHITEFRAME Specifies a box with a frame drawn with the same color as the window backgrounds. This color is white in the default Windows color scheme.
130. SS_WHITERECT Specifies a rectangle filled with the current window background color. This color is white in the default Windows color scheme.
131.
132.
133. The following dialog box styles can be specified in the dwStyle parameter:
134.
135. Style Meaning
136. DS_3DLOOK Gives the dialog box a nonbold font and draws three-dimensional borders around control windows in the dialog box.The DS_3DLOOK style is required only by Win32-based applications compiled for versions of Windows earlier than Windows 95 or Windows NT 4.0. The system automatically applies the three-dimensional look to dialog boxes created by applications compiled for current versions of Windows.
137. DS_ABSALIGN Indicates that the coordinates of the dialog box are screen coordinates; otherwise, Windows assumes they are client coordinates.
138. DS_CENTER Centers the dialog box in the working area; that is, the area not obscured by the tray.
139. DS_CENTERMOUSE Centers the mouse cursor in the dialog box.
140. DS_CONTEXTHELP Includes a question mark in the title bar of the dialog box. When the user clicks the question mark, the cursor changes to a question mark with a pointer. If the user then clicks a control in the dialog box, the control receives a WM_HELP message. The control should pass the message to the dialog procedure, which should call the WinHelp function using the HELP_WM_HELP command. The Help application displays a pop-up window that typically contains help for the control.Note that DS_CONTEXTHELP is just a placeholder. When the dialog box is created, the system checks for DS_CONTEXTHELP and, if it is there, adds WS_EX_CONTEXTHELP to the extended style of the dialog box. WS_EX_CONTEXTHELP cannot be used with the WS_MAXIMIZEBOX or WS_MINIMIZEBOX styles.
141. DS_CONTROL Creates a dialog box that works well as a child window of another dialog box, much like a page in a property sheet. This style allows the user to tab among the control windows of a child dialog box, use its accelerator keys, and so on.
142. DS_FIXEDSYS Use SYSTEM_FIXED_FONT instead of SYSTEM_FONT.
143. DS_LOCALEDIT Applies to 16-bit applications only. This style directs edit controls in the dialog box to allocate memory from the application's data segment. Otherwise, edit controls allocate storage from a global memory object.
144. DS_MODALFRAME Creates a dialog box with a modal dialog-box frame that can be combined with a title bar and window menu by specifying the WS_CAPTION and WS_SYSMENU styles.
145. DS_NOFAILCREATE Creates the dialog box even if errors occur ?for example, if a child window cannot be created or if the system cannot create a special data segment for an edit control.
146. DS_NOIDLEMSG Suppresses WM_ENTERIDLE messages that Windows would otherwise send to the owner of the dialog box while the dialog box is displayed.
147. DS_RECURSE Dialog box style for control-like dialog boxes.
148. DS_SETFONT Indicates that the dialog box template (the DLGTEMPLATE structure) contains two additional members specifying a font name and point size. The corresponding font is used to display text within the dialog box client area and within the dialog box controls. Windows passes the handle of the font to the dialog box and to each control by sending them the WM_SETFONT message.
149. DS_SETFOREGROUND Does not apply to 16-bit versions of Microsoft Windows. This style brings the dialog box to the foreground. Internally, Windows calls the SetForegroundWindow function for the dialog box.
150. DS_SYSMODAL Creates a system-modal dialog box. This style causes the dialog box to have the WS_EX_TOPMOST style, but otherwise has no effect on the dialog box or the behavior of other windows in the system when the dialog box is displayed.
相关文章推荐
- 获取指定窗口信息(坐标,窗口风格)
- WinAPI: GetClassName - 获取指定窗口的类名
- WinApi: GetParent、SetParent、MoveWindow - 获取、指定父窗口和移动窗口
- DELPHI GetClassName - 获取指定窗口的类名
- WinAPI: GetParent - 获取指定窗口的父窗口句柄
- MFC获取当前窗口指定区域的图片
- WinAPI: GetClassName - 获取指定窗口的类名
- WinAPI: GetClassName - 获取指定窗口的类名
- Google Map API v2 (三)----- 地图上添加标记(Marker),标记info窗口,即指定经纬度获取地址字符串
- WinAPI: GetTopWindow - 获取指定窗口的子窗口中最顶层的窗口句柄
- DELPHI GetClassName - 获取指定窗口的类名
- VC2008获取指定的窗口句柄
- [MFC] MFC 获取指定窗口截图(大小可调)
- WinAPI: GetNextWindow - 获取指定窗口Z上或Z下的窗口的句柄
- (转)获取指定进程的主窗口句柄
- 怎么用C#获取指定窗口的句柄(笔记)
- WinAPI: GetNextWindow - 获取指定窗口Z上或Z下的窗口的句柄
- WinAPI: GetWindow - 获取与指定窗口具有指定关系的窗口的句柄
- 获取指定窗口句柄结束进程 OpenProcess FindWindow GetExitCodeprocess TerminateProcess
- 易语言获取焦点命令激活指定窗口