The Second Window State

In the WND structure, the state member’s bits were already all defined by version 3.51, if not earlier. A second set, prosaically named state2, was introduced for version 4.0. Demand was apparently very high: state2 was full too as early as version 5.0. Additions for version 5.0 redefined a few of the originals, but the assignment of bit fields in state2 has been stable ever since.

Microsoft’s names and definitions of bit fields in union with state2 as a ULONG are known from symbol files for WIN32K.SYS from Windows 7 only.

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

Mask Index Bit Field Definition Window Flag Name Versions Remarks
0x00000001 0x0401
INT bWMPaintSent: 1;
WFWMPAINTSENT 4.0 and higher previously 0x01000000 in ExStyle
0x00000002 0x0402
INT bEndPaintInvalidate: 1;
WFDONTVALIDATE 4.0 and higher previously 0x02000000 in ExStyle
0x00000004 0x0404
INT bStartPaint: 1;
WFSTARTPAINT 4.0 and higher previously 0x04000000 in ExStyle
0x00000008 0x0408
INT bOldUI: 1;
WFOLDUI 4.0 and higher  
0x00000010 0x0410
INT bHasClientEdge: 1;
WFCEPRESENT 4.0 and higher  
0x00000020 0x0420
INT bBottomMost: 1;
WFBOTTOMMOST 4.0 and higher  
0x00000040 0x0440
INT bFullScreen: 1;
WFFULLSCREEN 4.0 and higher  
0x00000080 0x0480   WFWIN40COMPAT 4.0 only next as 0x00000200
INT bInDestroy: 1;
WFINDESTROY 5.0 and higher previously 0x00000400
0x00000100 0x0501   WFSYNCPAINTPENDING 4.0 only next as 0x00800000 in state
INT bWin31Compat: 1;
WFWIN31COMPAT 5.0 and higher previously 0x00800000 in state
0x00000200 0x0502   WFBEINGACTIVATED 4.0 only next as 0x00100000 in state
INT bWin40Compat: 1;
WFWIN40COMPAT 5.0 and higher previously 0x00000080
0x00000400 0x0504   WFINDESTROY 4.0 only next as 0x00000080
INT bWin50Compat: 1;
WFWIN50COMPAT 5.0 and higher  
0x00000800 0x0508
INT bMaximizeMonitorRegion: 1;
WFMAXFAKEREGIONAL 5.0 and higher  
0x00001000 0x0510
INT bCloseButtonDown: 1;
WFCLOSEBUTTONDOWN 5.0 and higher  
0x00002000 0x0520
INT bMaximizeButtonDown: 1;
WFZOOMBUTTONDOWN 5.0 and higher  
0x00004000 0x0540
INT bMinimizeButtonDown: 1;
WFREDUCEBUTTONDOWN 5.0 and higher  
0x00008000 0x0580
INT bHelpButtonDown: 1;
WFHELPBUTTONDOWN 5.0 and higher  
0x00010000 0x0601
INT bScrollBarLineUpBtnDown: 1;
WFLINEUPBUTTONDOWN 5.0 and higher  
0x00020000 0x0602
INT bScrollBarPageUpBtnDown: 1;
WFPAGEUPBUTTONDOWN 5.0 and higher  
0x00040000 0x0604
INT bScrollBarPageDownBtnDown: 1;
WFPAGEDNBUTTONDOWN 5.0 and higher  
0x00080000 0x0608
INT bScrollBarLineDownBtnDown: 1;
WFLINEDNBUTTONDOWN 5.0 and higher  
0x00100000 0x0610
INT bAnyScrollButtonDown: 1;
WFSCROLLBUTTONDOWN 5.0 and higher  
0x00200000 0x0620
INT bScrollBarVerticalTracking: 1;
WFVERTSCROLLTRACK 5.0 and higher  
0x00400000 0x0640
INT bForceNCPaint: 1;
WFALWAYSSENDNCPAINT 5.0 and higher previously 0x01000000 in state
0x00800000 0x0680
INT bForceFullNCPaintClipRgn: 1;
WFPIXIEHACK 5.0 and higher previously 0x02000000 in state
0x07000000 0x0707
INT FullScreenMode : 3;
  5.0 and higher previously bFullScreen in WND
0x08000000 0x0708
INT bCaptionTextTruncated: 1;
WEFTRUNCATEDCAPTION 5.0 and higher  
0x10000000 0x0710
INT bNoMinmaxAnimatedRects: 1;
WFNOANIMATE (5.0) 5.0 and higher  
0x20000000 0x0720
INT bSmallIconFromWMQueryDrag: 1;
WFSMQUERYDRAGICON 5.0 and higher previously 0x00400000 in ExStyle
0x40000000 0x0740
INT bShellHookRegistered: 1;
WFSHELLHOOKWND 5.0 and higher previously 0x00800000 in ExStyle
0x80000000 0x0780
INT bWMCreateMsgProcessed: 1;
  5.0 and higher  

The window flag that debugger extensions for Windows 2000 name as WFPIXIEHACK has a more descriptive (if less impish) name as a bit field in Windows 7. Whether the flag’s names ever were synchronised, or have become so, is not known. For all known versions, even as late as Windows 10, symbol files show that the internal routine that sets this flag is named PixieHack.