win11 dark scrollbars

62 views
Skip to first unread message

SRD

unread,
Jul 26, 2024, 11:41:58 AMJul 26
to scintilla-interest
I noticed in Notepad++ which uses scintilla, that they have somehow gotten the scrollbars to be dark when the system is set to dark mode. 

Anyone know how they did that? Or where that might be located in scintilla itself?

Thanks


Neil Hodgson

unread,
Jul 27, 2024, 6:32:59 PMJul 27
to Scintilla mailing list
SRD:

> Or where that might be located in scintilla itself?

Scintilla just uses standard Windows scroll bars which are drawn completely by Windows. Their presence is determined by the application specifying the scrollbar request flags when creating a "Scintilla" window: WS_VSCROLL | WS_HSCROLL.

Neil

Stan Day

unread,
Jul 28, 2024, 6:59:33 AMJul 28
to scintilla...@googlegroups.com
Neil, that's interesting. I'm running the latest win11. I know this is probably outside the scope of Scintilla, but I don't know who else might know. In Notepad++ scrollbars look like the first image below (and they are part of the scintilla component), in a regular edit window, they always look like the 2nd image. I'd like to "force" the edit control's scrollbar to look like the Notepad++ scrollbar. Is there a StyleHook being called on scintilla somewhere? I was hoping there was some DWM call or something to make this work. I was able to finally get dark captionbars using new DWM calls. Hoping there was something like that for scrollbars too.

darksb3.png 
Dark
lightsb.png
Light



--
You received this message because you are subscribed to a topic in the Google Groups "scintilla-interest" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/scintilla-interest/1bFA_4l_2Xw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to scintilla-inter...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scintilla-interest/3A533F1B-7633-45CF-980D-1F02DEDBDA73%40me.com.

marc

unread,
Jul 28, 2024, 1:20:32 PMJul 28
to scintilla-interest
You just need the HWND of your scintilla window...

SetWindowTheme(wnd, is_dark ? L"DarkMode_Explorer" : nullptr, nullptr);

SRD

unread,
Jul 28, 2024, 5:20:25 PMJul 28
to scintilla-interest
Marc,

You can NOT believe how long I've been looking for this! Thanks! In my Delphi program I used this for dark:

SetWindowTheme( Memo1.Handle, 'DarkMode_Explorer', nil);

or this for light:

SetWindowTheme( Memo1.Handle, 'LightMode_Explorer', nil);

And that finally worked for all the components I used it on. Thanks again

Stan

marc

unread,
Jul 29, 2024, 4:04:27 AMJul 29
to scintilla-interest
I do have a question for Neil on this. Is it possible to get the HWND of the auto complete control?

Untitled.png

Marc



Andrew Truckle

unread,
Jul 30, 2024, 5:07:20 AMJul 30
to scintilla-interest
If Windows apps are MFC based then they will not support dark mode. But if the Windows apps are the newer ones that work through the Microsoft Store (WinUI apps is it?) then they will support dark mode.

Neil Hodgson

unread,
Jul 30, 2024, 8:04:02 AMJul 30
to Scintilla mailing list
Marc:

> Is it possible to get the HWND of the auto complete control?

Use Win32 APIs like FindWindowEx to find the HWND. The class name for the auto-complete is "ListBoxX".

Neil

Reply all
Reply to author
Forward
0 new messages