4

Is there a way (API, dlls, msstyles ...) to modify the style (remove some elemets, change colors, width, ...) of all scrollbars that appear in Windows 10?

For example from this enter image description here to this enter image description here

Patrik
  • 83
  • 1
  • 5

2 Answers2

3

You don't need to write a program if you want to change all scrollbars on your system. In fact, it would be a colossal undertaking to do so. You would have to hook the Windows API functions that are responsible for drawing scrollbars and replace them with your own drawing code. Aside from the fact that an advanced understanding of Win32 programming will be required (far more than anyone can teach you in a single Stack Overflow answer), it will be extremely difficult to ensure that your code behaves identically to the original. Application bugs are inevitable, even after lots of testing. No user who cares about the stability of their system will want to run such an application.

From your screenshot, it looks like you just want to change the width/height of the scrollbars to make them smaller. Although the UI for customizing advanced Appearance properties has been removed from Windows 8 and later versions, the metrics can be set manually in the registry. Scrollbar size is among them.

  1. Navigate to the following registry key: HKEY_CURRENT_USER\Control Panel\Desktop\WindowMetrics
  2. Set the ScrollWidth and ScrollHeight values to your desired size in pixels, multiplied by -15.
    For example, to set your scrollbars to only 8 pixels, you would set the values to -120. (This is the smallest that you can go.) The default value is -255.
  3. Restart your computer to ensure that the changes take effect.

If you aren't comfortable modifying the registry, you can use a third-party application to do it for you, such as Winaero Tweaker.

Be forewarned, however, that compatibility problems are not to be unexpected with either of these solutions. If the Windows team intended to support custom-sized scrollbars, they would have left the Appearance customization interface intact.

Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574
  • 1
    Thanks for your answer. I know that is not a simple task. That's the reason why I wrote my question here because I didn't find detailed information (specification) about rendering of scrollbars (dll, functions, ...). I think it is not necessary to learn entire Win32 to achieve this change. I know the registry hack with `WindowMetrics` but it changes only the with and height of the scrollbars. My fault that I used bad example :-/ My primary goal is to remove unwanted elements from the scrolbars or at least change the colors of these elements (for example to white color). – Patrik Feb 20 '16 at 13:48
  • 2
    I found `SetSysColors` function from `user32.dll` but it is not working for me yet (C#). I tried also change the registry value of `HKEY_CURRENT_USER\Control Panel\Colors\Scrollbar` to the white RGB value but the change doesn't work for me. – Patrik Feb 20 '16 at 13:48
  • 1
    Yeah, `COLOR_SCROLLBAR` hasn't had any effect since 16-bit Windows. Scrollbars use either a checkerboard combination of `COLOR_3DFACE` and `COLOR_3DHIGHLIGHT`, or just the solid color `COLOR_3DHIGHLIGHT`. As I stated, the only way to do this is hooking all of the scrollbar related functions and doing your own drawing. I'm not even sure if it is possible. If all of the scrollbar drawing code is not centralized in a single API, then you'll be grasping at straws. It will certainly be necessary to learn advanced Win32 programming to do this. And won't be possible from a managed language like C#. – Cody Gray - on strike Feb 20 '16 at 13:58
  • @Patrik have you ever gotten any further meanwhile? – Manticore Mar 18 '20 at 10:27
  • For colors I found these registry keys on the Microsoft Q&A website: `HKEY_CURRENT_USER\Control Panel\Colors` `HKEY_CURRENT_USER\Control Panel\Desktop\Colors` Then edit the 'Scrollbar' key with an RGB value. – foxesque Aug 15 '21 at 09:12
0

Here's a tool for enabling custom 3rd-party themes for Windows 10 and Windows 11: https://github.com/namazso/SecureUxTheme

Basically, you need to create or download a theme, patch it & apply it with this tool. In your theme you can define colors for scrollbars, among other things.

If you'd like to edit/modify .msstyles files, use this tool: https://github.com/nptr/msstyleEditor

Eric
  • 91
  • 5