• No results found

Styles Common to All Classes

In document Win32_API_tutorials (Page 121-125)

Step 5: Assignment 2 to see if you can visualized ―a little‖ on what is going on

18. Styles Common to All Classes

Base Window Styles

The following window styles are shared by all windows, regardless of their class. They generally describe the window's general appearance, although many of the styles apply best to non-control windows (particularly overlapped windows).

Styles

WS_BORDER

The window has a thin-line border.

WS_CAPTION

The window has a title bar.

WS_CHILD, WS_CHILDWINDOW

The window is a child window. These windows cannot have menu bars nor can have the WS_POPUP style.

WS_CLIPCHILDREN

For a parent window, exclude the areas occupied by child windows when drawing within the window (to avoid drawing on any child windows).

WS_CLIPSIBLINGS

For a child window, exclude the areas occupied by fellow children of the window's parent when drawing within the window (to avoid drawing on any sibling windows).

WS_DISABLED

The window is disabled.

WS_DLGFRAME

The window has a border style typical of dialog boxes. These windows cannot have a title bar.

WS_GROUP

Identifies the first control in a group of controls. Any controls

following this one are assumed to be part of this control's group, until a control with the WS_GROUP style is encountered.

WS_HSCROLL

The window has a horizontal scroll bar.

WS_MAXIMIZE

The window is maximized.

WS_MAXIMIZEBOX

The window has a maximize button. This cannot be used on windows having the WS_EX_CONTEXTHELP extended window style. The WS_SYSMENU window style must also be specified.

WS_MINIMIZE, WS_ICONIC The window is minimized.

WS_MINIMIZEBOX

The window has a minimize button. This cannot be used on windows having the WS_EX_CONTEXTHELP extended window style. The WS_SYSMENU window style must also be specified.

WS_OVERLAPPED, WS_TILED

The window is an overlapped window, which as a title bar and a border.

WS_OVERLAPPEDWINDOW, WS_TILEDWINDOW

The window is an overlapped window, having a title bar, a sizing border, a title bar, a system menu, and minimize and maximize boxes.

WS_POPUP

The window is a popup window. This cannot be used with the WS_CHILD window style.

WS_POPUPWINDOW

The window is a popup window, having a thin-line border and system menu.

The window can only be visible if it also has the WS_CAPTION window style.

WS_SIZEBOX

Same as WS_THICKFRAME.

WS_SYSMENU

The window has a system menu on its title bar. The WS_CAPTION window style must also be specified.

WS_TABSTOP

The control can press Tab repeatedly to set the focus to this control.

WS_THICKFRAME

The window has a sizing border.

WS_VISIBLE

The window is visible.

WS_VSCROLL

The window has a vertical scroll bar.

Constant Definitions

Below is a list of the extended window styles. The main difference between these and regular window styles is that these are specified as a separate value. (For example, a call to

CreateWindowEx takes one parameter for extended window styles and a second parameter for "regular" window styles.) These styles can be applied to any type of window, although many of them apply best to overlapped windows.

Extended Styles

WS_EX_ACCEPTFILES

The window accepts files via a drag-and-drop operation.

WS_EX_APPWINDOW

The window also appears on the taskbar whenever it is visible.

WS_EX_CLIENTEDGE

The window has a border with a sunken edge.

WS_EX_CONTEXTHELP

A context-help button appears on the title bar. This cannot be used with the WS_MAXIMIZEBOX or WS_MINIMIZEBOX regular window styles.

WS_EX_CONTROLPARENT

The window contains children which can be TABbed through.

WS_EX_DLGMODALFRAME

The window has a modal dialog frame (a double border).

WS_EX_LAYERED

Windows 2000: The window is a layered window.

WS_EX_LAYOUTRTL

Windows 2000: The window's coordinate system places the horizontal origin on the right side, with increasing x values to the left and decreasing x values to the right.

WS_EX_LEFT

The window has generic left-aligned properties.

WS_EX_LEFTSCROLLBAR

If the language supports reading order alignment, position the vertical scroll bar (if any) to the left of the client area.

WS_EX_LTRREADING

Display window text using left-to-right reading.

WS_EX_MDICHILD

The window is an MDI child window.

WS_EX_NOACTIVATE

Windows 2000: The window is never brought to the foreground as a result of direct user action.

WS_EX_NOINHERITLAYOUT

Windows 2000: Do not pass the window's layout to its child windows.

WS_EX_NOPARENTNOTRIFY

If the window is a child window, do not notify the parent window when the child window is created or destroyed.

WS_EX_OVERLAPPEDWINDOW

The window has the border of a typical overlapped window.

WS_EX_PALETTEWINDOW

The window is a topmost toolbar window with a raised edge, normally used for a floating palette.

WS_EX_RIGHT

The window has generic right-aligned properties, if the language supports reading order alignment.

WS_EX_RIGHTSCROLLBAR

Display the vertical scroll bar (if any) to the right of the client area.

WS_EX_RTLREADING

Display window text using right-to-left reading, if the language supports reading order alignment.

WS_EX_STATICEDGE

The window has a three-dimensional border intended for items which do not accept user input.

WS_EX_TOOLWINDOW

The window is designed to be a floating toolbar window, having a small title bar area.

WS_EX_TOPMOST

The window appears above all non-topmost windows, even if it is not active.

WS_EX_TRANSPARENT

The window appears transparent because its sibling windows below it are drawn first.

WS_EX_WINDOWEDGE

The window has a border with a raised edge.

Constant Definitions

Note: Some of the values of the extended window style flags are not listed. If you know their values, please e-mail me about them.

Const WS_EX_ACCEPTFILES = &H10 Const WS_EX_APPWINDOW = &H40000 Const WS_EX_CLIENTEDGE = &H200 Const WS_EX_CONTEXTHELP = &H400

Const WS_EX_CONTROLPARENT = &H10000 Const WS_EX_DLGMODALFRAME = &H1 ' Const WS_EX_LAYERED = ???

' Const WS_EX_LAYOUTRTL = ???

Const WS_EX_LEFT = &H0

Const WS_EX_LEFTSCROLLBAR = &H4000 Const WS_EX_LTRREADING = &H0

Const WS_EX_MDICHILD = &H40

Const WS_EX_NOACTIVATE = &H8000000 ' Const WS_EX_NOINHERITLAYOUT = ???

Const WS_EX_NOPARENTNOTIFY = &H4 Const WS_EX_OVERLAPPEDWINDOW = &H300 Const WS_EX_PALETTEWINDOW = &H188 Const WS_EX_RIGHT = &H1000

Const WS_EX_RIGHTSCROLLBAR = &H0 Const WS_EX_RTLREADING = &H2000 Const WS_EX_STATICEDGE = &H20000 Const WS_EX_TOOLWINDOW = &H80 Const WS_EX_TOPMOST = &H8 Const WS_EX_TRANSPARENT = &H20 Const WS_EX_WINDOWEDGE = &H100

19. App Part 1: Creating controls at

In document Win32_API_tutorials (Page 121-125)