This change moves main-window setup to WM_CREATE to avoid invalid initial layouts, improves dialog focus and window-placement restoration, and includes a wide set of Win32/UI correctness fixes across the app. It also adds thread-stack and Wow64 safety handling, improves token details (authority/RID and elevated-privilege highlighting), and broadens the low-level documentation comments. The update also adjusts a few build settings in CustomBuildTool to improve runtime behavior.
This prevents the main tab selection from activating the main window and stealing foreground focus from the user when starting hidden by default. Focus is still forwarded later via `PhMwpOnSetFocus` when the window is activated. Fixes#2989.
Co-Authored-By: Zeroes1 <Zeroes1@gmail.com>
Reworks the TabNew control around message-based helpers and centralized layout flushing, adds new flags/messages (including thin-tab metrics), and improves font/theme/DPI handling, painting, and delete notifications. Page tracking is now synchronized through item-to-page links, with safer delete-all behavior and consistent page index updates after insert/move/delete.
Main window tab handling was migrated to the new TabNew wrappers/atom creation path, including selection and layout save/restore calls, and now resyncs cached page indexes on selection changes so reordered tabs activate the correct page.
Eliminate the main-window-DPI globals that bleed across dialogs on
secondary monitors. Window-aware code now passes its own DPI:
- Delete PhSystemDpi, PhSmallIconSize, PhLargeIconSize and
PhGuiSupportUpdateSystemMetrics; remove the mainwnd.c invocation
on WM_DPICHANGED.
- PhGetApplicationIcon and PhGetStockApplicationIcon now require a
WindowDpi parameter; PhGetApplicationIconEx is folded into
PhGetApplicationIcon. PhGetStockApplicationIcon keeps the shared
icon contract via a 4-slot DPI-keyed cache so multiple monitors
coexist without thrash.
- All ~50 callers updated to source DPI from their owning window
(PhGetWindowDpi for hwnd-bearing call sites; PhGetTaskbarDpi for
the tray icon; PhGetSystemDpi for window-class registration and
parentless task dialogs).
- PhSetApplicationWindowIcon now thin-wraps PhSetApplicationWindowIconEx
with PhGetWindowDpi(hwnd), so the 63 legacy call sites get
per-window-DPI icons without per-site edits.
- srvprv.c and mainwnd.c read PhProcessImageListWindowDpi instead
of PhSystemDpi/PhSmallIconSize.X for service and process icons.
Introduce many new highlighting settings and UI grouping for Options -> Highlighting, including thread, network, environment, token, memory and module color options. Add menu flags to highlight native/mapped modules and several thread wait types; wire them into dialogs and list handling. Rename and use cached process monitor settings (PhCsEnableProcessMonitor / PhCsProcessMonitorLookback / PhCsProcessMonitorCacheLimit) and update related checks. Fix TreeNew invalidation/sorting behavior to avoid unconditional rebuilds and ensure proper node invalidation. Populate default settings and cached getters for the new options.