Geoff Chappell, Software Analyst
CURRENT WORK ITEM - PREVIEW ONLY
The bit flags that the Windows 7 symbol files for WIN32K.SYS presents in union with the WND member named style are defined in multiple structures, presumably to allow multiple meanings.
As is well known, the low 16 bits of a window style are class-specific. The type information in the symbol files from Windows 7 do not show these as being defined formally as bit fields except to be named as reserved or unused. The USEREXTS and USERKDX debugger extensions, as supplied in the Device Driver Kit (DDK) for Windows NT 4.0 and then for Windows 2000 but apparently not since, have names that likely reproduce macros from Microsoft’s headers. These name a sort of index into the set of window flags that comprises the state, state2, ExStyle and style members considered as an array of bytes. The high byte in each such 16-bit index is the byte offset to the flag and the low byte is the bit mask within that byte. Where a name is known from this source, the versions in parentheses are of the debugger extension.
Each window style anyway has documented macros for its use with Windows API functions, e.g., in the dwStyle argument of CreateWindow. Where the debugger extensions tell of an index, the tables below show the corresponding style. Understand, however, that the tables below exist only to show known names for the way that WINSRV and WIN32K access the bit flags in the WND, not to list all possible window styles.
This is not to say that accounting for which window styles are defined or available or supported in which Windows versions is not an exercise without merit. Reasons are abundant for thinking that MIcrosoft’s published literature on the question, meaning both documentation and C-language headers for programming, is unreliable. This should mean, of course, that tracking the changes has been done well enough by many enough others by now.
Window Style | Window Flag | ||
---|---|---|---|
Mask | Name | Index | Name (4.0 to 5.0) |
0x0000000F | BS_TYPEMASK | 0x0C0F | BFTYPEMASK (4.0 only) |
0x00000020 | BS_LEFTTEXT BS_RIGHTBUTTON |
0x0C20 | BFRIGHTBUTTON (5.0) |
0x00000040 | BS_ICON | 0x0C40 | BFICON (5.0) |
0x00000080 | BS_BITMAP | 0x0C80 | BFBITMAP (5.0) |
0x00000100 | BS_LEFT | 0x0D01 | BFLEFT |
0x00000200 | BS_RIGHT | 0x0D02 | BFRIGHT |
0x00000300 | BS_CENTER | 0x0D03 | BFCENTER BFHORZMASK (4.0 only) |
0x00000400 | BS_TOP | 0x0D04 | BFTOP |
0x00000800 | BS_BOTTOM | 0x0D08 | BFBOTTOM |
0x00000C00 | BS_VCENTER | 0x0D0C | BFVCENTER BFVERTMASK (4.0 only) |
0x0D0F | BFALIGNMASK (4.0 only) | ||
0x00001000 | BS_PUSHLIKE | 0x0D10 | BFPUSHLIKE |
0x00002000 | BS_MULTILINE | 0x0D20 | BFMULTILINE BFRIGHTBUTTON (4.0 only) |
0x00004000 | BS_NOTIFY | 0x0D40 | BFICON (4.0 only) BFNOTIFY |
0x00008000 | BS_FLAT | 0x0D80 | BFBITMAP (4.0 only) BFFLAT |
0x0DC0 | BFIMAGEMASK (4.0 only) |
Window Style | Window Flag | ||
---|---|---|---|
Mask | Name | Index | Name (4.0 to 5.0) |
0x00000001 | CBS_SIMPLE | 0x0C01 | CBFEDITABLE CBFSIMPLE |
0x00000002 | CBS_DROPDOWN | 0x0C02 | CBFDROPDOWN CBFDROPPABLE |
0x00000003 | CBS_DROPDOWNLIST | 0x0C03 | CBFDROPDOWNLIST CBFDROPTYPE |
0x00000010 | CBS_OWNERDRAWFIXED | 0x0C10 | CBFOWNERDRAWFIXED |
0x00000020 | CBS_OWNERDRAWVARIABLE | 0x0C20 | CBFOWNERDRAWVAR |
0x0C30 | CBFOWNERDRAW | ||
0x00000040 | CBS_AUTOHSCROLL | 0x0C40 | CBFAUTOHSCROLL |
0x00000080 | CBS_OEMCONVERT | 0x0C80 | CBFOEMCONVERT |
0x00000100 | CBS_SORT | 0x0D01 | CBFSORT |
0x00000200 | CBS_HASSTRINGS | 0x0D02 | CBFHASSTRINGS |
0x00000400 | CBS_NOINTEGRALHEIGHT | 0x0D04 | CBFNOINTEGRALHEIGHT |
0x00000800 | CBS_DISABLENOSCROLL | 0x0D08 | CBFDISABLENOSCROLL |
0x0D10 | CBFBUTTONUPTRACK | ||
0x00002000 | CBS_UPPERCASE | 0x0D20 | CBFUPPERCASE |
0x00004000 | CBS_LOWERCASE | 0x0D40 | CBFLOWERCASE |
Window Style | Window Flag | ||
---|---|---|---|
Mask | Name | Index | Name (4.0 to 5.0 |
0x00000002 | DS_SYSMODAL | 0x0C02 | DFSYSMODAL |
0x00000004 | DS_3DLOOK | 0x0C04 | DF3DLOOK |
0x00000010 | DS_NOFAILCREATE | 0x0C10 | DFNOFAILCREATE |
0x00000020 | DS_LOCALEDIT | 0x0C20 | DFLOCALEDIT |
0x00000100 | DS_NOIDLEMSG | 0x0D01 | WFNOIDLEMSG |
0x00000400 | DS_CONTROL | 0x0D04 | DFCONTROL |
Window Style | Window Flag | ||
---|---|---|---|
Mask | Name | Index | Name (4.0 to 5.0) |
0x00000004 | ES_MULTILINE | 0x0C04 | EFMULTILINE |
0x00000008 | ES_UPPERCASE | 0x0C08 | EFUPPERCASE |
0x00000010 | ES_LOWERCASE | 0x0C10 | EFLOWERCASE |
0x00000020 | ES_PASSWORD | 0x0C20 | EFPASSWORD |
0x00000040 | ES_AUTOVSCROLL | 0x0C40 | EFAUTOVSCROLL |
0x00000080 | ES_AUTOHSCROLL | 0x0C80 | EFAUTOHSCROLL |
0x00000100 | ES_NOHIDESEL | 0x0D01 | EFNOHIDESEL |
0x0D02 | EFCOMBOBOX | ||
0x00000400 | ES_OEMCONVERT | 0x0D04 | EFOEMCONVERT |
0x00000800 | ES_READONLY | 0x0D08 | EFREADONLY |
0x00001000 | ES_WANTRETURN | 0x0D10 | EFWANTRETURN |
0x00002000 | ES_NUMBER | 0x0D20 | EFNUMBER (5.0) |
Window Style | Window Flag | ||
---|---|---|---|
Mask | Name | Index | Name (4.0 to 5.0) |
0x00000002 | SBS_LEFTALIGN SBS_SIZEBOXTOPLEFTALIGN SBS_TOPALIGN |
0x0C02 | SBFSIZEBOXTOPLEFT |
0x00000004 | SBS_BOTTOMALIGN SBS_RIGHTALIGN SBS_SIZEBOXBOTTOMRIGHTALIGN |
0x0C04 | SBFSIZEBOXBOTTOMRIGHT |
0x00000008 | SBS_SIZEBOX | 0x0C08 | SBFSIZEBOX |
0x00000010 | SBS_SIZEGRIP | 0x0C10 | SBFSIZEGRIP |
Window Style | Window Flag | ||
---|---|---|---|
Mask | Name | Index | Name (4.0 to 5.0) |
0x0000001F | SS_TYPEMASK | 0x0C1F | SFTYPEMASK (4.0 only) |
0x00000080 | SS_NOPREFIX | 0x0C80 | SFNOPREFIX |
0x00000100 | SS_NOTIFY | 0x0D01 | SFNOTIFY |
0x00000200 | SS_CENTERIMAGE | 0x0D02 | SFCENTER (4.0 only) SFCENTERIMAGE (5.0) |
0x00000400 | SS_RIGHTJUST | 0x0D04 | SFRIGHT (4.0 only) SFRIGHTJUST (5.0) |
0x00000800 | SS_REALSIZEIMAGE | 0x0D08 | SFREALSIZE (4.0 only) SFREALSIZEIMAGE (5.0) |
0x00001000 | SS_SUNKEN | 0x0D10 | SFSUNKEN |
0x00002000 | SS_EDITCONTROL | 0x0D20 | SFEDITCONTROL (5.0) |
0x0000C000 | SS_ELLIPSISMASK | 0x0DC0 | SFELLIPSISMASK (5.0) |
The high 16 bits of a window style apply to all windows independently of their window class. According to the symbol files for WIN32K.SYS from Windows 7, these do have formal definitions as bit fields.
Bit Field | Window Style | Window Flag | ||
---|---|---|---|---|
Mask | Definition (6.1) | Index | Name (3.51 to 5.0) | |
INT bReserved1 : 16; |
||||
0x00010000 |
INT bWS_MAXIMIZEBOX : 1; |
WS_MAXIMIZEBOX | 0x0A01 (3.51); 0x0E01 |
WFMAXBOX |
Bit Field | Window Style | Window Flag | ||
---|---|---|---|---|
Mask | Definition (6.1) | Index | Name (3.51 to 5.0) | |
INT bReserved2 : 16; |
||||
0x00010000 |
INT bWS_TABSTOP : 1; |
WS_TABSTOP | 0x0A01 (3.51); 0x0E01 |
WFTABSTOP |
Bit Field | Window Style | Window Flag | ||
---|---|---|---|---|
Mask | Definition (6.1) | Index | Name (3.51 to 5.0) | |
INT bReserved3 : 16; |
||||
INT bUnused5 : 1; |
||||
0x00020000 |
INT bWS_MINIMIZEBOX : 1; |
WS_MINIMIZEBOX | 0x0A02 (3.51); 0x0E02 |
WFMINBOX |
Bit Field | Window Style | Window Flag | ||
---|---|---|---|---|
Mask | Definition (6.1) | Index | Name (3.51 to 5.0) | |
INT bReserved4 : 16; |
||||
INT bUnused6 : 1; |
||||
0x00020000 |
INT bWS_GROUP : 1; |
WS_GROUP | 0x0A02 (3.51); 0x0E02 |
WFGROUP |
Bit Field | Window Style | |
---|---|---|
Mask | Definition (6.1) | |
INT bReserved5 : 16; |
||
INT bUnused7 : 2; |
||
0x00040000 |
INT bWS_THICKFRAME : 1; |
WS_THICKFRAME |
Bit Field | Window Style | Window Flag | ||
---|---|---|---|---|
Mask | Definition (6.1) | Index | Name (3.51 to 5.0) | |
INT bReserved6 : 16; |
||||
INT bUnused8 : 2; |
||||
0x00040000 |
INT bWS_SIZEBOX : 1; |
WS_SIZEBOX | 0x0A04 (3.51); 0x0E04 |
WFSIZEBOX |
Bit Field | Window Style | Window Flag | ||
---|---|---|---|---|
Mask | Definition (6.1) | Index | Name (3.51 to 5.0) | |
INT bReserved7 : 16; |
||||
INT bUnused9 : 3; |
||||
0x00080000 |
INT bWS_SYSMENU : 1; |
WS_SYSMENU | 0x0A08 (3.51); 0x0E08 |
WFSYSMENU |
0x00100000 |
INT bWS_HSCROLL : 1; |
WS_HSCROLL | 0x0A10 (3.51); 0x0E10 |
WFHSCROLL |
0x00200000 |
INT bWS_VSCROLL : 1; |
WS_VSCROLL | 0x0A20 (3.51); 0x0E20 |
WFVSCROLL |
0x00400000 |
INT bWS_DLGFRAME : 1; |
WS_DLGFRAME | 0x0A40 (3.51); 0x0E40 |
WFDLGFRAME WFTOPLEVEL |
0x00800000 |
INT bWS_BORDER : 1; |
WS_BORDER | 0x0A80 (3.51); 0x0E80 |
WFBORDER |
0x00C00000 | WS_CAPTION | 0x0AC0 (3.51); 0x0EC0 |
WFBORDERMASK (4.0 only) WFCAPTION |
|
0x00000000 | WS_TILED | 0x0B00 (3.51); 0x0F00 |
WFTILED | |
0x01000000 |
INT bMaximized : 1; |
WS_MAXIMIZE | 0x0B01 (3.51); 0x0F01 |
WFMAXIMIZED |
0x02000000 |
INT bWS_CLIPCHILDREN : 1; |
WS_CLIPCHILDREN | 0x0B02 (3.51); 0x0F02 |
WFCLIPCHILDREN |
0x04000000 |
INT bWS_CLIPSIBLINGS : 1; |
WS_CLIPSIBLINGS | 0x0B04 (3.51); 0x0F04 |
WFCLIPSIBLINGS |
0x08000000 |
INT bDisabled : 1; |
WS_DISABLED | 0x0B08 (3.51); 0x0F08 |
WFDISABLED |
0x10000000 |
INT bVisible : 1; |
WS_VISIBLE | 0x0B10 (3.51); 0x0F10 |
WFVISIBLE |
0x20000000 |
INT bMinimized : 1; |
WS_ICONIC WS_MINIMIZE |
0x0B20 (3.51); 0x0F20 |
WFMINIMZED |
0x40000000 |
INT bWS_CHILD : 1; |
WS_CHILD WS_CHILDWINDOW |
0x0B40 (3.51); 0x0F40 |
WFCHILD |
0x80000000 |
INT bWS_POPUP : 1; |
WS_POPUP | 0x0B80 (3.51); 0x0F80 |
WFPOPUP |
0x0BC0 (3.51); 0x0FC0 |
WFICONICPOPUP WFTYPEMASK (4.0 only) |