Windows & Darkmode

I am aware Xojo cannot create real ‘darkmode’ apps for win 10.
But is there a way to make the top border black = you know the part were the minimise, maximize and close buttons are. Declares or MBS plugins?
If this is possible we could fake a darkmode quite easily.

I believe that you can do it programmatically using the SetSystColors API function. There is a sister GetSystColors function also in case you need to read colors to know what to change back to.

I am not sure whether this is going to be limited to your current window, or it will apply to all.

I’m not familiar constructing declares. Any pointers how to?

I’ve been slowly building Windows Dark Mode support classes for GraffitiSuite. Some things are done, others aren’t. For instance, the titlebar will take on the dark theme, context menus, some controls. The menubar is still unthemed, and other controls I’ve written custom components for that use the colors for the system theme.

In order to color the title bar you have to put the app in dark mode, and the window in dark mode using declares, and the implementation is a bit tricky.

The declare would look something like this.

Soft Declare Function SetSysColors Lib "user32.dll" (ByVal cElements As Int32, lpaElements As int32, lpaRgbValues As int32) As int32

Now, this is just the declare. Doing something with it is another story! There are about two dozen constants to manupulate, and so on. It is not for the faint of heart and if you are not already very familiar with using the Win32 API, I second Anthony’s suggestion to wait for GraffitiSuite to do it for you.

Now, as a personal preference, I stay as far away as I can from dark themed applications. IMHO (well, not so humble…), it is a fad that is getting way too much attention. (oh boy, will I get stoned for this last comment! :wink: )

SetSysColors changes the specified values for all windows, if I remember correctly, not updates your own window to match the theme. The theming API is a different beast altogether.

Once again, you are correct. I thought that perhaps it could be limited to a single window, but this definitely disproves the hypothesis:

yep… wrong way about it.

Sorry, that suite is way too expensive given what it delivers.