Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Window Styles Reference
#1
Hi All,

It always drove me crazy not knowing what any of the win styles meant for windows, buttons, etc

I found this reference at the MSDN library and pasted it below:

Perhaps these definitions could be incorporated into QM - like the definitions for Regular Expressions are.

Enjoy,
Stuart

Quote:http://msdn2.microsoft.com/en-us/library...S.80).aspx



Window Styles

WS_BORDER Creates a window that has a border.

WS_CAPTION Creates a window that has a title bar (implies the WS_BORDER style). Cannot be used with the WS_DLGFRAME style.

WS_CHILD Creates a child window. Cannot be used with the WS_POPUP style.

WS_CHILDWINDOW Same as the WS_CHILD style.

WS_CLIPCHILDREN Excludes the area occupied by child windows when you draw within the parent window. Used when you create the parent window.

WS_CLIPSIBLINGS Clips child windows relative to each other; that is, when a particular child window receives a paint message, the WS_CLIPSIBLINGS style clips all other overlapped child windows out of the region of the child window to be updated. (If WS_CLIPSIBLINGS is not given and child windows overlap, when you draw within the client area of a child window, it is possible to draw within the client area of a neighboring child window.) For use with the WS_CHILD style only.

WS_DISABLED Creates a window that is initially disabled.

WS_DLGFRAME Creates a window with a double border but no title.

WS_GROUP Specifies the first control of a group of controls in which the user can move from one control to the next with the arrow keys. All controls defined with the WS_GROUP style FALSE after the first control belong to the same group. The next control with the WS_GROUP style starts the next group (that is, one group ends where the next begins).

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 of maximum size.

WS_MAXIMIZEBOX Creates a window that has a Maximize button.

WS_MINIMIZE Creates a window that is initially minimized. For use with the WS_OVERLAPPED style only.

WS_MINIMIZEBOX Creates a window that has a Minimize button.

WS_OVERLAPPED Creates an overlapped window. An overlapped window usually has a caption and a border.

WS_OVERLAPPEDWINDOW Creates an overlapped window with the WS_OVERLAPPED, WS_CAPTION, WS_SYSMENU, WS_THICKFRAME, WS_MINIMIZEBOX, and WS_MAXIMIZEBOX styles.

WS_POPUP Creates a pop-up window. Cannot be used with the WS_CHILD style.

WS_POPUPWINDOW Creates a pop-up window with the WS_BORDER, WS_POPUP, and WS_SYSMENU styles. The WS_CAPTION style must be combined with the WS_POPUPWINDOW style to make the Control menu visible.

WS_SIZEBOX Creates a window that has a sizing border. Same as the WS_THICKFRAME style.

WS_SYSMENU Creates a window that has a Control-menu box in its title bar. Used only for windows with title bars.

WS_TABSTOP Specifies one of any number of controls through which the user can move by using the TAB key. The TAB key moves the user to the next control specified by the WS_TABSTOP style.

WS_THICKFRAME Creates a window with a thick frame that can be used to size the window.

WS_TILED Creates an overlapped window. An overlapped window has a title bar and a border. Same as the WS_OVERLAPPED style.

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.

WS_VISIBLE Creates a window that is initially visible.

WS_VSCROLL Creates a window that has a vertical scroll bar.



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 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 Allows the user to navigate among the child windows of the window by using the TAB key.

WS_EX_DLGMODALFRAME 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 Places a vertical scroll bar to the left of the client area.

WS_EX_LTRREADING Displays the window text using left-to-right reading order properties. This is the default.

WS_EX_MDICHILD 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 Combines the WS_EX_CLIENTEDGE and WS_EX_WINDOWEDGE styles

WS_EX_PALETTEWINDOW Combines the WS_EX_WINDOWEDGE and WS_EX_TOPMOST styles.

WS_EX_RIGHT 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 Displays the window text using right-to-left reading order properties.

WS_EX_STATICEDGE Creates a window with a three-dimensional border style intended to be used for items that do not accept user input.

WS_EX_TOOLWINDOW 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 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.


Button Styles

BS_3STATE Same as a check box, except that the box can be dimmed as well as checked. The dimmed state typically is used to show that a check box has been disabled.

BS_AUTO3STATE Same as a three-state check box, except that the box changes its state when the user selects it.

BS_AUTOCHECKBOX Same as a check box, except that a check mark appears in the check box when the user selects the box; the check mark disappears the next time the user selects the box.

BS_AUTORADIOBUTTON Same as a radio button, except that when the user selects it, the button automatically highlights itself and removes the selection from any other radio buttons with the same style in the same group.

BS_BITMAP Specifies that the button displays a bitmap.

BS_BOTTOM Places text at the bottom of the button rectangle.

BS_CENTER Centers text horizontally in the button rectangle.

BS_CHECKBOX Creates a small square that has text displayed to its right (unless this style is combined with the BS_LEFTTEXT style).

BS_DEFPUSHBUTTON Creates a button that has a heavy black border. The user can select this button by pressing the ENTER key. This style enables the user to quickly select the most likely option (the default option).

BS_FLAT Specifies that the button is two-dimensional; it does not use the default shading to create a 3-D image.

BS_GROUPBOX Creates a rectangle in which other buttons can be grouped. Any text associated with this style is displayed in the rectangle's upper-left corner.

BS_ICON Specifies that the button displays an icon.

BS_LEFT Left aligns 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 aligned on the right side of the check box or radio button.

BS_LEFTTEXT When combined with a radio-button or check-box style, the text appears on the left side of the radio button or check box.

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.

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.

BS_OWNERDRAW Creates an owner-drawn button. The framework calls the DrawItem member function when a visual aspect of the button has changed. This style must be set when using the CBitmapButton class.

BS_PUSHBUTTON Creates a pushbutton that posts a WM_COMMAND message to the owner window when the user selects the button.

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.

BS_RADIOBUTTON Creates a small circle that has text displayed to its right (unless this style is combined with the BS_LEFTTEXT style). Radio buttons are usually used in groups of related, but mutually exclusive, choices.

BS_RIGHT Right aligns 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 right aligned on the right side of the check box or radio button.

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.

BS_TEXT Specifies that the button displays text.

BS_TOP Places text at the top of the button rectangle.

BS_USERBUTTON Obsolete, but provided for compatibility with 16-bit versions of Windows. Win32-based applications should use BS_OWNERDRAW instead.

BS_VCENTER Places text in the middle (vertically) of the button rectangle.

etc, etc. see link[/quote]
#2
Hi,

I would like to have a button in a dialog not be adjustable by the user for size.
Can't seem to find this

Also, I don't want it to be selectable - i.e. the dashed frame around the default selected button.

Thanks!!,
Stuart
#3
I see how to fix the resizing: Switch WS_THICKFRAME to WS_THICKFRAME

but not the select frame.

Thanks,
Stuart
#4
WS_TABSTOP Specifies one of any number of controls through which the user can move by using the TAB key. The TAB key moves the user to the next control specified by the WS_TABSTOP style.

Just remove this style.
#5
I should have mentioned that I already removed that but still having one default with the select frame.

weird.

S
#6
Set focus to some other control when clicked.

Or instead use a Static control with SS_NOTIFY style.

This example has both.

Function Dialog38
Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

str controls = "4 5"
str e4 si5
si5="&mouse.ico"
if(!ShowDialog("Dialog38" &Dialog38 &controls)) ret

;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 223 135 "Dialog"
;4 Edit 0x54030080 0x200 10 36 96 14 ""
;3 Button 0x54022000 0x0 10 10 60 16 "Button"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;5 Static 0x54000103 0x0 156 8 16 16 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2020104 "" "" ""


ret
;messages
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case 3 ;;Button clicked
,;do something, then:
,act id(4 hDlg)
,
,case 5
,out "Icon clicked. Must have SS_NOTIFY style."
,
,case IDOK
,case IDCANCEL
ret 1
#7
Thanks for the suggestion of the act statement.

I added a button to which I set the act statement but the button is below the size of the dialog so it's invisible.

Then in each case statement I reset the act to that button again otherwise the frame would be invisible until I clicked a particular button then it would switch to the visible ones and persist. Now it shows up for just a millisecond when clicked then disappears as it resets to the invisible button.

Code:
Copy      Help
sel wParam
,act id(7 hDlg)
,case 3
,,if(but(lParam))
,,,out "PACS-Mouse ON"
,,,act id(7 hDlg)

Not elegant but it works.

Thanks,
Stuart


Forum Jump:


Users browsing this thread: 1 Guest(s)