A top-level window that is layered, or has a window region, now shows
as it does on Windows instead of as an opaque rectangle:
SetLayeredWindowAttributes' color key and constant alpha, and
UpdateLayeredWindow's picture with its own premultiplied alpha (from a
32-bit DIB section), the constant alpha over it, a color key or
ULW_OPAQUE. UpdateLayeredWindowIndirect is added. As on Windows, a
layered window shows nothing until it has attributes or a picture,
UpdateLayeredWindow fails after SetLayeredWindowAttributes until
WS_EX_LAYERED is set again, and the mouse goes through fully transparent
pixels, and through all of a window with WS_EX_TRANSPARENT.
user_layered.cpp composes the look as premultiplied ARGB and the areas
that show and take the mouse; the backends use them:
- X11: a 32-bit visual when a compositing manager holds _NET_WM_CM_Sn,
otherwise a bounding shape; the input shape either way (SHAPE, from
libXext when there is one). Changing between them remakes the window.
- Wayland: ARGB8888 buffers and an input region.
- macOS: a window that is not opaque, drawn with premultiplied alpha.
The desktop DC blends translucent windows when it reads the screen.
wintest checks the screen and WindowFromPoint for half alpha, a color
key, WS_EX_TRANSPARENT, a per-pixel picture with a hole, a constant
alpha of zero, moving by UpdateLayeredWindow, and a window region. The
X11 path was checked under Xvfb with and without a compositor's
selection, and Wayland under a headless weston.
Signed-off-by: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRw4kkFHrrHRhkcuLw
A change to the registry file reached a program only when it started.
Each program now watches the file's directory (inotify on Linux, kqueue
on macOS, on a thread of its own that waits in the kernel) and, when the
file changes, wakes the threads looking for messages. The first of them
reads the colors, the gradient and the window metrics again and applies
what the file changed since it last read it, as Windows applies a change
from Control Panel: colors with WM_SYSCOLORCHANGE, sizes and fonts with
WM_SETTINGCHANGE and the frames worked out again, the gradient with
WM_SETTINGCHANGE. A value the program set itself (SetSysColors,
SystemParametersInfo) stays until the file changes that value. Menu and
message box fonts are made again after a change.
SPIF_UPDATEINIFILE saves SPI_SETNONCLIENTMETRICS's sizes (in negative
twips, as Windows writes them) and fonts ("face,points[,bold]") and
SPI_SETGRADIENTCAPTIONS, so one program can restyle every other one.
wintest checks a hand edit of the file, replaced as an editor saves it,
reaching an open window (color, caption height, client area), a color
the program set staying, the classic look coming back when the keys go,
and SPIF_UPDATEINIFILE's values in the registry.
Signed-off-by: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRw4kkFHrrHRhkcuLw
The frame sizes and the nonclient fonts were fixed. They now come from
HKCU\Control Panel\Desktop\WindowMetrics when a program starts, by
Windows' names: BorderWidth, CaptionWidth, CaptionHeight, the small
caption, menu and scroll bar sizes, in pixels or (as Windows keeps them)
negative twips; and CaptionFont, SmCaptionFont, MenuFont, StatusFont,
MessageFont and IconFont, as "face,points[,bold][,italic]" or a
Windows LOGFONTW. GetSystemMetrics, SPI_GETNONCLIENTMETRICS and
SPI_GETICONTITLELOGFONT answer from them, together with the colors.
SPI_SETNONCLIENTMETRICS changes them for the session: top-level windows
get WM_SETTINGCHANGE and their frames are worked out again.
wintest's theme child now checks a caption height in twips, a border
width and a caption font by name, and SPI_SETNONCLIENTMETRICS taking a
taller caption from an open window's client area.
Signed-off-by: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRw4kkFHrrHRhkcuLw
The system colors were a fixed table. They now come from
HKEY_CURRENT_USER\Control Panel\Colors when a program starts, by
Windows' names ("ActiveTitle"="0 0 128"), over the classic scheme.
SetSysColors changes them for the session; the system color brushes
follow, each top-level window gets WM_SYSCOLORCHANGE, and all are drawn
again. Captions shade from the title color to its gradient color when
SPI_GETGRADIENTCAPTIONS says so: SPI_SETGRADIENTCAPTIONS, or in the
registry UserPreferencesMask's bit 0x10 or "GradientCaptions" under
Control Panel\Desktop.
So that a person can edit it, the registry file now writes strings as
"name"="text" and numbers as "name"=dword:hex, as regedit does, and
reads them back; other types stay type:hex bytes.
The configuration directory is ~/.config/libmfc (or
$XDG_CONFIG_HOME/libmfc), for the registry, the .ini files and the
Windows directory, in place of ~/.config/winport.
wintest checks, natively, the file's text form and a hand edit of it,
the colors and gradient a newly started program reads, SetSysColors
with its brush and message, and a shaded caption.
Signed-off-by: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRw4kkFHrrHRhkcuLw
The caption's system menu box was left empty. It now shows the
window's small icon (WM_GETICON, then the class's small and big icons,
then the system's application icon), and the frame is drawn again when
WM_SETICON or SetClassLongPtr changes an icon.
The desktop gets the window's icons too, for its taskbar, window
switcher or dock: _NET_WM_ICON on X11, xdg-toplevel-icon-v1 on Wayland
(square shared-memory pictures, kept until the icon is replaced) and
the application's icon on macOS, from its main window.
On Wayland each toplevel asks for client-side decorations through
xdg-decoration-unstable-v1, so that a compositor that draws frames
(KDE's, wlroots') does not put its title bar above the window's own
caption.
wintest checks the caption icon natively.
Signed-off-by: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRw4kkFHrrHRhkcuLw
- IConnectionPoint::EnumConnections for the layer's own points (fonts'
and pictures' property notifications).
- IViewObject::Freeze and Unfreeze in the object handler: a frozen
aspect draws, and gives its extent, as it was.
- IBinding::Suspend and Resume for URL bindings.
- ITypeInfo::GetTypeComp and ITypeLib::GetTypeComp: names bound to
members (a type's, then its bases'), to enumerations' and modules'
members, and to types.
- VariantCopy of VT_RECORD, through the record's IRecordInfo.
- Pictures save as icon files, placeable metafiles and enhanced
metafiles, and load from them.
- SetData on OleGetClipboard's data object puts the data on the
clipboard beside what is there.
- IRichEditOle::GetClipboardData (a range as rich text, Unicode and
ANSI), ImportDataObject (text, or an object made from the data),
ConvertObject and ActivateAs.
- CoTreatAsClass and CoGetTreatAsClass keep emulation in the registry,
and CoGetClassObject follows it.
wintest and richtest check them natively.
Signed-off-by: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRw4kkFHrrHRhkcuLw
wtltest now builds and passes against the portable layer, ANSI and
Unicode, and the native CI jobs fetch WTL so that it runs there.
The layer gained what WTL calls:
- Declarations: common controls 6 (split buttons, cue banners, list
view groups and tiles, toolbar metrics, rebar chevrons), uxtheme.h,
GDI's gradients, glyph indices, fractional widths and pixel formats,
layered windows, PrintWindow, cursor and scroll bar information,
the shell namespace and folder browser, IPrintDialogCallback, the
_s printf forms and the basetsd conversion macros.
- Implementations: one monitor (MonitorFromWindow and the rest, which
were declared but missing), layered window attributes, PrintWindow
through a WM_PRINT that now draws the frame and the children,
GetScrollBarInfo, GetCursorInfo, flat scroll bars over the window's
own, DrawShadowText, GradientFill, glyph indices and the *I and
float width functions, GetFontUnicodeRanges, a metafile's
description, palette and pixel format, CreateFontIndirectEx,
ExtractAssociatedIcon and DuplicateIcon, CoGetMalloc and SHGetMalloc,
DECIMAL conversions and comparison (exact, rounding half to even),
visual styles off (the classic look), and OpenGL absent.
- The shell namespace over the file system (ID lists of path
components, IShellFolder, IEnumIDList, the IL* functions) and
SHBrowseForFolder as a tree dialog with the BFFM_ messages.
- Dialog templates built in memory with 32-bit WCHAR text, as WTL's
CIndirectDialogImpl writes them natively, are read too.
- WM_ERASEBKGND in a DC that is not the window's own erases at the
logical origin, as WM_PRINTCLIENT draws.
wintest covers the new functions natively. fetch-wtl.sh uses shasum
where there is no sha256sum (macOS).
Signed-off-by: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRw4kkFHrrHRhkcuLw
iotest calls GetEnvironmentStringsA only without UNICODE, where the
SDK headers name it. wintest's symbol font check needs Wingdings on
Windows, which Wine does not have, so it is skipped there when the
font is missing. Wine's MMIO_DELETE reports success but leaves the
file, so audiotest checks that the file is gone only elsewhere.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRw4kkFHrrHRhkcuLw
Signed-off-by: Claude <noreply@anthropic.com>
A font named Symbol or Wingdings is a symbol font whatever its LOGFONT
says: GetTextMetrics reports SYMBOL_CHARSET and the A text functions
read each byte as its own character. U+F020 to U+F0FF fold to the byte,
as Windows has it. When the font itself is not installed, each
character is drawn as its Unicode counterpart, from the stand-in family
or from a symbol font that has it (Symbola, Noto Sans Symbols, DejaVu
Sans and others). Symbol follows the Adobe Symbol encoding's mapping;
the Wingdings table covers the characters with clear Unicode
counterparts, most of them from Unicode 7.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRw4kkFHrrHRhkcuLw
Signed-off-by: Claude <noreply@anthropic.com>
EnableWindow(FALSE) took the focus away from any child of the window, so
a dialog that DialogBox disabled for its modal child no longer had the
focus when it was deactivated, could not remember it, and gave it to its
first control when the modal dialog ended. Only the window itself loses
the focus now, as on Windows, and the control comes back.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRw4kkFHrrHRhkcuLw
Signed-off-by: Claude <noreply@anthropic.com>
A window answering HTTRANSPARENT (a group box, a static without
SS_NOTIFY) now passes the point to the siblings beneath it, as Windows
does, instead of to its parent, so controls inside a group box get their
clicks. SendInput, mouse_event and keybd_event feed the same paths as
the backends' input.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRw4kkFHrrHRhkcuLw
Signed-off-by: Claude <noreply@anthropic.com>
CreatePipe and PeekNamedPipe, and a child's standard handles through
STARTF_USESTDHANDLES (CreateProcessW now passes its STARTUPINFO on). A
pipe whose other end is closed reports ERROR_BROKEN_PIPE or
ERROR_NO_DATA, and a write to it no longer stops the program.
Serial ports over termios: "COM1" is $WINPORT_COM1 or the first serial
device, and a device path opens as a port. GetCommState/SetCommState,
BuildCommDCB, COMMTIMEOUTS, the modem lines, PurgeComm, ClearCommError,
EscapeCommFunction, WaitCommEvent and SetCommMask; on a port opened
with FILE_FLAG_OVERLAPPED, reads, writes and event waits run in the
background, with GetOverlappedResult and CancelIo.
The ListView_, TabCtrl_ and TreeView_ macros, winsock.h, and commctrl.h
under WIN32_LEAN_AND_MEAN (it needs objidl.h for LPSTREAM).
The new iotest covers pipes, a child, and a port over a
pseudo-terminal.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRw4kkFHrrHRhkcuLw
Signed-off-by: Claude <noreply@anthropic.com>
WinInet's HTTPS was missing on Linux and macOS: an https URL failed to
connect. It now goes through a TLS layer (port/src/tls.cpp). On Linux
that is OpenSSL (libssl 3 or 1.1), loaded with dlopen when first used;
WINPORT_LIBSSL names the library when it is elsewhere. On macOS it is
Secure Transport, loaded the same way. Neither needs headers to build.
The server's certificate is checked as WinInet checks it: whether its
authority is trusted, whether it is for the host asked for, and whether
it is in date. Each problem gives its own error
(ERROR_INTERNET_INVALID_CA, ERROR_INTERNET_SEC_CERT_CN_INVALID,
ERROR_INTERNET_SEC_CERT_DATE_INVALID). The matching
INTERNET_OPTION_SECURITY_FLAGS flag on the request, or its
INTERNET_FLAG_IGNORE_CERT_* flags, lets each problem go.
QueryOption reports SECURITY_FLAG_SECURE.
inettest runs openssl s_server with a certificate of its own for
localhost. It checks that the unknown authority and the wrong host are
refused, and that each is let go by its flag, through the API and
through CHttpFile.
PlgBlt draws the source rectangle onto a parallelogram, through a mask
if one is given, in software. wintest checks a straight copy, a quarter
turn and a mask.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRw4kkFHrrHRhkcuLw
Signed-off-by: Claude <noreply@anthropic.com>
These were the last functions in port/src/stubs.txt. Nothing on Linux
or macOS fails as unimplemented any more.
WinHelp: there is no WinHelp viewer, so the port opens a document next
to the program's .hlp file instead: the same name as .html, .htm, .pdf
or .txt, or a folder with an index.html. It uses the desktop's opener
(xdg-open or open), or the command WINPORT_HELP names. A help context
becomes the HTML page's anchor (help.html#131072). MFC's Help commands
work through it.
Gopher: GopherCreateLocator, GopherGetLocatorType, GopherFindFirstFile
(menus, submenus and index searches, then InternetFindNextFile),
GopherOpenFile (text with its dot escaping undone, binary, and gopher+
views) and GopherGetAttribute (gopher+ attributes, all of them or one
block). gopher:// URLs work through InternetOpenUrl. inettest runs a
gopher server of its own and tests it on the port; Windows dropped
gopher with IE 7, and Wine's is a stub.
CoInternetCreateSecurityManager: zones without Windows' settings. Local
files and res: are the local machine; a share or a host without a dot
is the intranet; everything else is the internet. Each zone has a
policy for ProcessUrlAction. There are security ids, and SetZoneMapping
and GetZoneMappings for the process. A service provider's own manager
is asked first. CDHtmlDialog uses it to decide window.external, and
htmltest now tests it directly.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRw4kkFHrrHRhkcuLw
Signed-off-by: Claude <noreply@anthropic.com>
DragQueryFile, DragFinish and SetWindowRgn were stubs that failed, and
DragAcceptFiles and DragQueryPoint were missing.
- An HDROP is the shell's: a DROPFILES (now in shlobj.h) and the
paths, wide or narrow, so a drop made by the program or taken from
CF_HDROP reads the same. DragAcceptFiles sets WS_EX_ACCEPTFILES.
- Files dragged from other programs arrive as WM_DROPFILES at the
window under the pointer that takes them: through XDND (text/uri-list)
on X11, and NSFilenamesPboardType on macOS.
- SetWindowRgn gives a window a shape: it neither draws nor takes the
mouse outside it, and its siblings and parent draw there instead.
GetWindowRgn returns it.
wintest checks the shape (WindowFromPoint and the DC's clip box) and
drops of wide and narrow paths. The X11 drop was tried by hand under
Xvfb with a small XDND source.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRw4kkFHrrHRhkcuLw
Signed-off-by: Claude <noreply@anthropic.com>
- comctl_rebar.cpp: the rebar (bands in rows, breaks, dragging by the
gripper, the RB_ messages, the children's notifications passed to the
parent), the pager (buttons in the non-client area, PGN_CALCSIZE and
PGN_SCROLL) and SysLink (the <a> markup, word wrap, LM_ messages,
NM_CLICK and NM_RETURN).
- comctl_extra.cpp: the IP address control (four fields, IPM_ messages,
IPN_FIELDCHANGED, the address as window text), ComboBoxEx (an
owner-drawn combo box inside, images and indents, CBEM_ messages and
CBEN_ notifications) and the animation control (uncompressed and RLE8
AVI clips from resources or files, ACN_START and ACN_STOP).
- comctl_date.cpp: the month calendar (selection and ranges, day
states, colors, the first day of the week, hit testing, keys) and the
date and time picker (custom formats, editing the fields with the
keys, DTS_SHOWNONE and DTS_UPDOWN, the drop-down calendar, DTN_
notifications).
- Painting: a child with a frame gets WM_NCPAINT when its parent is
repainted, so the pager's buttons draw.
- commctrl.h: the pager's, rebar's, ComboBoxEx's and date controls'
structures and constants that were missing.
- Tests: wintest's TestMoreControls drives the IP address, ComboBoxEx,
month calendar, date and time picker and animation controls through
their messages, and passes natively and under Wine; cmntest joins the
native test list.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRw4kkFHrrHRhkcuLw
Signed-off-by: Claude <noreply@anthropic.com>
The portable layer now prints. Its printers are the CUPS queues that
lpstat lists and "Save as PDF". A printer DC takes its paper, orientation
and resolution from the DEVMODE (300 dpi by default, Letter or A4 by the
locale), with a quarter inch the printer cannot print on, and draws each
page between StartPage and EndPage as a picture. EndPage adds it to a
PDF file (compressed with zlib when the system has it, else run-length
encoded), and EndDoc hands the file to lp, or leaves it where DOCINFO
says, or in ~/Documents. SetAbortProc's procedure runs at each EndPage;
AbortDoc and ResetDC work.
PrintDlg and PageSetupDlg return the default printer's DEVNAMES and
DEVMODE (A and W forms) or show their dialogs: Print, Print Setup and
Page Setup, with the control IDs of a new dlgs.h, hooks, page ranges,
copies, paper, orientation, margins and a sample page.
CommDlgExtendedError reports their errors.
Print preview in sditest and mditest now passes natively; dlgtest,
sditest and mditest join the native test list. wintest prints a job to
a file, checks printer DCs and drives both dialogs through their hooks.
Under Wine 9 the test printer uses the wineps print processor, without
which StartDoc fails.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRw4kkFHrrHRhkcuLw
Signed-off-by: Claude <noreply@anthropic.com>
Under Wine, the checks added with the window manager failed where they
leaned on the portable layer's own behavior:
- The MDI frame is sized through WM_SIZE with the real client size,
which DefFrameProc uses to place the MDI client.
- WM_MDITILE's result is not checked: Windows documents TRUE, Wine
returns 0. The portable layer now returns TRUE, not the count, for
WM_MDITILE and WM_MDICASCADE.
- A 50% blend is checked over a 2x2 block, since Windows may dither it.
- Type-ahead WM_CHARs carry a repeat count, without which list and
tree views ignore them.
- Wine keeps the second item's icon place after the list view changes
to the list view style, so only the first item is checked there.
- A click on a tree view label queues its release first, because
Windows watches for a drag until the button comes up.
testutil.h ends the output directory with the separator it already
uses, so OLE monikers on Windows get backslashes again (oletest and
linktest failed with forward slashes).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRw4kkFHrrHRhkcuLw
Signed-off-by: Claude <noreply@anthropic.com>
Adds PropertySheet, CreatePropertySheetPage and DestroyPropertySheetPage
in comctl_propsheet.cpp: tabbed sheets with OK, Cancel, Apply and Help,
wizards with Back, Next and Finish, modal and modeless, and the PSM_
messages. The dialog code reports a template's size so a page's
template can be copied and made a child. The dialog sample now runs
natively, and wintest covers sheets and wizards.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRw4kkFHrrHRhkcuLw
Signed-off-by: Claude <noreply@anthropic.com>
Adds SysTreeView32 in comctl_treeview.cpp: items that open and close,
lines and buttons, check boxes, selection by mouse and keyboard,
type-ahead, label editing, sorting, callbacks, drop highlighting, the
insert mark, custom drawing and drag images. wintest covers it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRw4kkFHrrHRhkcuLw
Signed-off-by: Claude <noreply@anthropic.com>
Adds SysListView32 in comctl_listview.cpp: the icon, small icon, list
and report views, columns through a header child, subitems, callbacks
and owner data, selection by mouse and keyboard, type-ahead, label
editing, sorting, check boxes, grid lines, full-row selection, custom
and owner drawing, and drag images. wintest covers it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRw4kkFHrrHRhkcuLw
Signed-off-by: Claude <noreply@anthropic.com>
Adds the simpler common controls in comctl_simple.cpp, the keyboard
layout behind MapVirtualKey and GetKeyNameText, and puts a status bar
without CCS_TOP along its parent's bottom edge. wintest covers the new
controls.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRw4kkFHrrHRhkcuLw
Signed-off-by: Claude <noreply@anthropic.com>
ImageList_* with masks and alpha: adding bitmaps, masked bitmaps and
icons, drawing plain, transparent, over a color, as a mask, blended and
with overlays, getting icons back, merging and duplicating, dragging an
image over a window, and reading and writing a list to a stream.
GetDIBits and SetDIBits now carry the alpha byte of 32-bit pixels, and
copying an icon's 32-bit image keeps its alpha.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRw4kkFHrrHRhkcuLw
Signed-off-by: Claude <noreply@anthropic.com>
The MDIClient class with WM_MDICREATE and the rest of the WM_MDI
messages, DefFrameProc and DefMDIChildProc, CreateMDIWindow and
TranslateMDISysAccel. The client lists its children in the window menu,
and a maximized child hides its caption and puts its system menu,
buttons and title in the frame. CascadeWindows, TileWindows and
ArrangeIconicWindows arrange MDI children or top-level windows.
The test helpers write their logs with forward slashes, which every
system takes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRw4kkFHrrHRhkcuLw
Signed-off-by: Claude <noreply@anthropic.com>
Dialogs from templates (DLGTEMPLATE and DLGTEMPLATEEX), modal and
modeless, with keyboard navigation through IsDialogMessage and the
dialog item helpers. MessageBox is a dialog built at run time, and
falls back to the console when there is no display.
The standard controls: Button (push, check, radio, group box and owner
draw), Static, ScrollBar, Edit (single and multiline, with undo and the
clipboard), ListBox and ComboBox, plus DlgDirList and its relatives. The
clipboard lives in the process and converts between its text formats.
A parent without WS_CLIPCHILDREN now paints before a child that is
updated at once, so it no longer draws over that child.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRw4kkFHrrHRhkcuLw
Signed-off-by: Claude <noreply@anthropic.com>
Icons and cursors keep an AND mask and a color image, as on Windows;
LoadIcon, LoadCursor, LoadImage, CopyImage and DrawIconEx read them
from resources, .ico and .cur files and draw them, with the system's
own icons and cursors drawn in code. Accelerator tables load from
resources and TranslateAccelerator sends their commands.
Menus: building, changing and querying them, MENUITEMINFO and
MENUINFO, standard and extended templates, the menu bar, the system
menu, and TrackPopupMenu. Tracking runs its own message loop and
handles the mouse, arrow keys, Enter, Escape and mnemonics, sending
the notifications MFC relies on (WM_INITMENUPOPUP, WM_MENUSELECT,
WM_ENTERIDLE). DefWindowProc opens the bar for Alt, F10 and Alt+key,
and the system menu for Alt+Space and a click on its box.
DrawFrameControl draws buttons, caption buttons, scroll arrows and
menu glyphs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRw4kkFHrrHRhkcuLw
Signed-off-by: Claude <noreply@anthropic.com>
gdi_draw.cpp draws lines, polylines, Bezier curves, rectangles, rounded
rectangles, ellipses, arcs, chords, pies and polygons in software, with
one-pixel and styled pens, wide pens with their caps and joins, both
fill modes and the binary raster operations; paths (BeginPath through
SelectClipPath and PathToRegion) and flood fills.
font.cpp finds the system's TrueType and OpenType fonts, maps Windows
face names to similar installed families, and makes glyph images with
stb_truetype (public domain or MIT, vendored in port/src/third_party).
Without font files, text falls back on the public domain X11 6x13
bitmap font, built in. gdi_text.cpp draws and measures text (TextOut,
ExtTextOut, alignment, the background box, escapement, underline and
strikeout), gives font metrics and enumerates fonts, and implements
DrawText(Ex) with word breaks, tabs, prefixes and ellipses,
TabbedTextOut and GrayString.
NEWTEXTMETRIC now has the fields Windows gives it, and the Ex font
enumeration structures are declared. wintest checks shapes, fill modes,
paths and text.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRw4kkFHrrHRhkcuLw
Signed-off-by: Claude <noreply@anthropic.com>
Windows keeps child windows in the order they were made, which is a
dialog's tab order, so a new child goes to the bottom of the z-order.
wintest now checks that, and its CBT hook counts only windows of its own
class, since Wine makes windows of its own (for input methods).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRw4kkFHrrHRhkcuLw
Signed-off-by: Claude <noreply@anthropic.com>
Windows now exist outside Windows, kept in memory by a headless backend
until the X11, Wayland and Cocoa ones arrive:
- window classes and windows, the window tree, positions, z-order,
showing, minimizing and maximizing, window data and properties
- each thread's message queue: sending (also between threads, with
timeouts, notifications and callbacks), posting, GetMessage and
PeekMessage in Windows' order, WM_QUIT, timers, hooks, and
MsgWaitForMultipleObjects
- ANSI and Unicode window procedures, with text messages converted and
procedure handles for CallWindowProc, as on Windows
- focus, activation, capture, the keyboard state, mouse and key input
from a backend, double clicks, TrackMouseEvent, the caret
- painting: update regions, WM_PAINT, BeginPaint, RedrawWindow,
ScrollWindowEx; DefWindowProc with a classic frame, hit testing and
window scroll bars
- GDI in software: object handles, stock objects, pens, brushes,
fonts, palettes, bitmaps, DIB sections in every format, regions,
device contexts with clipping, SaveDC and mapping modes, raster
operations, fills, BitBlt, StretchBlt, MaskBlt, TransparentBlt,
AlphaBlend and DIBs drawn on a device
A new test, wintest, checks all of this; it runs natively and under
Wine, so the two agree.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRw4kkFHrrHRhkcuLw
Signed-off-by: Claude <noreply@anthropic.com>