Share via


Window and Message Box Styles

The following table shows window styles that are supported by Windows CE.

Basic window styles Description
WS_CHILD Specifies a child window. This should not be changed after the window is created.
WS_CLIPCHILDREN Excludes the area occupied by child windows when drawing occurs within the parent window. This style is used on the parent window. Windows CE–windows always have the WS_CLIPCHILDREN style.
WS_CLIPSIBLINGS Excludes the area that is occupied by sibling windows above a window.
WS_DISABLED Specifies a window that is initially disabled. A disabled window cannot receive input from the user.
WS_EX_NOACTIVATE Specifies that a window cannot be activated. If a child window has this style, tapping it does not cause its top-level parent to activate. Although a window that has this style will still receive stylus events, neither it nor its child windows can get the focus. This style is supported only by the Windows CE operating system (OS).
WS_EX_NOANIMATION Prevents a window from showing animated exploding and imploding rectangles and from having a button on the taskbar. This style is supported only by
Windows CE.
WS_EX_NODRAG Specifies a stationary window that cannot be dragged by its title bar. This style is supported only by Windows CE.
WS_EX_TOPMOST Creates a window that will be placed and remain above all non-topmost windows. To add or remove this style, use the SetWindowPos function.
WS_GROUP Specifies the first control of a group of controls. This style is used primarily when creating dialog boxes. The group consists of this first control and all controls that are defined after it, up to the next control for which the WS_GROUP style is specified. Because the first control in each group often has the WS_TABSTOP style, a user can move from group to group.
WS_POPUP Specifies a pop-up window. This style should not be changed after the window is created.
WS_TABSTOP Specifies a control that can receive the keyboard focus when the user presses the TAB key. This style is used primarily when creating controls in a dialog box. Pressing the TAB key changes the keyboard focus to the next control with the WS_TABSTOP style.
WS_VISIBLE Specifies a window that is initially visible. This style can be turned on and off to change window visibility.
Non-client area styles Description
WS_BORDER Specifies a window with a thin-line border.
WS_CAPTION Specifies a window with a title bar and border.
WS_DLGFRAME Specifies a window with a dialog box border style. A window with this style cannot have a title bar.
WS_EX_CAPTIONOKBTN Includes an OK button in the title bar.
WS_EX_CLIENTEDGE Specifies a window with a border that has a sunken edge.
WS_EX_CONTEXTHELP Includes a Help button (?) in the title bar of the window.
WS_EX_DLGMODALFRAME Specifies a window with a double border.
WS_EX_OVERLAPPEDWINDOW Combines the WS_EX_CLIENTEDGE and WS_EX_WINDOWEDGE styles.
WS_EX_STATICEDGE Specifies a window with a three-dimensional border style. This style should be used for items that do not accept user input.
WS_EX_WINDOWEDGE Specifies a window border with a raised edge.
WS_HSCROLL Specifies a window with a horizontal scroll bar.
WS_OVERLAPPED Specifies a window with the WS_BORDER and WS_CAPTION styles.
WS_SYSMENU Specifies a window with a window menu on its title bar. Use in conjunction with the WS_CAPTION style. Windows CE does not have a system menu, but you can use the WS_SYSMENU style to add the standard Close (X) button to a window title bar.
WS_VSCROLL Specifies a window with a vertical scroll bar.

The following table shows message box styles that are supported by Windows CE.

Button styles Description
MB_ABORTRETRYIGNORE Specifies that the message box contains three buttons: Abort, Retry, and Ignore.
MB_DEFBUTTON1 Specifies that the first button is the default button. The first button is always the default unless you specify MB_DEFBUTTON2.
MB_DEFBUTTON2 Specifies that the second button is the default button.
MB_DEFBUTTON3 Specifies that the third button is the default button.
MB_OK Specifies that the message box contains one button: OK.
MB_OKCANCEL Specifies that the message box contains two buttons: OK and Cancel.
MB_RETRYCANCEL Specifies that the message box contains two buttons: Retry and Cancel.
MB_YESNO Specifies that that the message box contains two buttons: Yes and No.
MB_YESNOCANCEL Specifies that the message box contains three buttons: Yes, No, and Cancel.
Icon styles Description
MB_ICONASTERISK
MB_ICONINFORMATION
Includes an icon consisting of a lowercase letter i in a circle in the message box.
MB_ICONERROR
MB_ICONHAND
MB_ICONSTOP
Includes a stop-sign icon in the message box.
MB_ICONEXCLAMATION
MB_ICONWARNING
Includes an exclamation-point icon in the message box.
MB_ICONQUESTION Includes a question-mark icon in the message box.
Window styles Description
MB_APPLMODAL Specifies that the user must respond to the message box before continuing work in the window that is identified by the hWnd parameter. However, the user can move to the windows of other applications and work in those windows.

Depending on the hierarchy of windows in the application, the user might be able to move to other windows within the application. All child windows of the message box's parent window are automatically disabled, but pop-up windows are not.

MB_APPLMODAL is the default value.
Windows CE does not support either MB_SYSTEMMODAL or MB_TASKMODAL.

MB_SETFOREGROUND Specifies that the message box becomes the foreground window.
MB_TOPMOST Creates the message box with the WS_EX_TOPMOST window style.

 Last updated on Tuesday, July 13, 2004

© 1992-2000 Microsoft Corporation. All rights reserved.