Hide Scrollbars
Hide vertical/horizontal scrollbars in selected processes (default: File Explorer) and reclaim the gutter space
Author: AmazingBodilyFluids
Shrinks the vertical and/or horizontal scrollbars away in the target
process. By default it targets explorer.exe, so the File Explorer file
list loses its scrollbar and the freed strip is used by the content
instead of sitting empty.
To apply it to other programs, add them to the mod's Custom process
inclusion list under the mod's Advanced settings in Windhawk.
Mouse-wheel and keyboard scrolling are unaffected.
Screenshots
Windows default (slim scrollbar in its own gutter):

With the mod (1px sliver, gutter reclaimed):

How it works
The mod hooks GetSystemMetrics, GetSystemMetricsForDpi and
GetThemeSysSize, and reports a size of 1px for SM_CXVSCROLL /
SM_CYHSCROLL (the vertical/horizontal scrollbar thickness). Code that
lays itself out from that metric - such as Explorer's DirectUI file list
- then shrinks the scrollbar to a 1px sliver. Plain Win32 windows that
draw standard non-client scrollbars are mostly unaffected, because
user32 lays those out from an internal metric table rather than the
exported function.
Why 1px and not 0
Reporting 0 makes the scrollbar disappear entirely, but a 0-width
scrollbar reads as "not scrollable" to the Windows precision-touchpad
pan handler, so two-finger scrolling stops working in the affected
windows. A 1px sliver is visually negligible and keeps precision-touchpad
scrolling working, so the mod uses 1px and does not expose a 0 option.
Mouse wheel and keyboard scrolling (arrows, PageUp/PageDown, Home/End)
work either way.
Notes
- The override is process-wide. Other mods running in the same process
that read
SM_CXVSCROLL / SM_CYHSCROLL (for example to hit-test the
scrollbar strip) will see the reduced value too.
SM_CXVSCROLL also drives the width of combo-box drop-down buttons
and the status-bar sizing grip. Code that reads the exported metric
(rather than user32's internal table) shrinks those too.
- The scrollbar arrow button metrics (
SM_CXHSCROLL / SM_CYVSCROLL)
and SPI_GETNONCLIENTMETRICS are left untouched, so a control that
mixes those with SM_CXVSCROLL may lay out slightly oddly.
- If a targeted process misbehaves, remove it from the inclusion list.
Settings
- Hide vertical scrollbars - toggle the vertical bar.
- Hide horizontal scrollbars - toggle the horizontal bar.