Click or drag to resize

ShellSearchEditWndProc Method

Processes Windows messages.

Namespace: Jam.Shell
Assembly: ShellBrowser (in ShellBrowser.dll) Version: 7.3
Syntax
protected override void WndProc(
	ref Message m
)

Parameters

m  Message
[in,out] The Windows Message to process.
Remarks
SBNET-1896: A ShellSearchEdit is a TextBox whose native client-edge border is drawn by the (non dark-mode aware) UxTheme "Edit" class, which always paints a hard white frame in the non-client area. When hosted in ShellAddressBar this white frame stands out against the surrounding address-bar background (most visibly against the dark background). We therefore paint the frame ourselves: first erase the native white frame in the non-client area with the control's BackColor (which ShellAddressBar keeps in sync with its own background), then draw a single subtle border in the SAME theme-aware color the ShellBreadCrumbBar/address-bar frame uses — ContrastControlDark, the color BrushAlternativeRenderer.DrawAlternativeBackground draws the breadcrumb bar's address-combobox frame with. This gives the SearchEdit the same light, non-intrusive framing as the BreadCrumbBar in both light and dark mode (neither a hard white frame nor borderless). IMPORTANT (flicker fix): the WM_NCPAINT frame is painted WITHOUT first calling base.WndProc for that message. The themed "Edit" class hot-tracks its border and emits a stream of WM_NCPAINT messages as the mouse enters/moves over/leaves the control. Letting the theme paint its (hot) border first and then overpainting it on every one of those messages caused the border to flash — heavy flickering on hover, most visible in light mode where the themed hot border is high-contrast against the white field. By suppressing the themed non-client paint and drawing our own border in a single pass, the frame is stable and no longer flickers. The themed border space is still reserved because WM_NCCALCSIZE continues to be handled by the base class.
See Also