Skip to content

Add Support for Custom System Color Overrides#2376

Merged
sdottaka merged 86 commits intomasterfrom
syscolor-hook
Oct 20, 2024
Merged

Add Support for Custom System Color Overrides#2376
sdottaka merged 86 commits intomasterfrom
syscolor-hook

Conversation

@sdottaka
Copy link
Member

@sdottaka sdottaka commented Jul 12, 2024

This PR hooks the Windows system color retrieval function GetSysColor() to return customized colors. This allows you to change the color of toolbars, status bars, etc. as shown below. However, this only works in some areas and does not currently apply to dialog windows, scroll bars, etc.

image

You can customize the system colors in the Colors/System category of the Options window.

image


CMenuBar();

virtual BOOL Create(CWnd* pParentWnd, DWORD dwStyle = WS_CHILD | WS_VISIBLE | CBRS_ALIGN_TOP, UINT nID = AFX_IDW_MENUBAR);

Check failure

Code scanning / CodeQL

Redefined default parameter

Parameter dwStyle redefines its default value to 1342185472 from the inherited default value 1342187520 (in CToolBar). The default value will be resolved statically, not by dispatch, so this can cause confusion.

CMenuBar();

virtual BOOL Create(CWnd* pParentWnd, DWORD dwStyle = WS_CHILD | WS_VISIBLE | CBRS_ALIGN_TOP, UINT nID = AFX_IDW_MENUBAR);

Check failure

Code scanning / CodeQL

Redefined default parameter

Parameter nID redefines its default value to 59398 from the inherited default value 59392 (in CToolBar). The default value will be resolved statically, not by dispatch, so this can cause confusion.
@sdottaka sdottaka changed the title WIP Add Support for Custom System Color Overrides Oct 20, 2024
@sdottaka sdottaka added this to the v2.16.43 milestone Oct 20, 2024
@sdottaka sdottaka marked this pull request as ready for review October 20, 2024 05:10
@sdottaka sdottaka merged commit b52a7cd into master Oct 20, 2024
@sdottaka sdottaka deleted the syscolor-hook branch October 20, 2024 09:35
@Gitoffthelawn
Copy link
Contributor

Do you think it will be possible to override scrollbar colours at some point?

@sdottaka
Copy link
Member Author

I think it's possible to make scrollbars color changeable, but it would require more work than other UI elements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants