Jump to content

Recommended Posts

Posted

@NoNameCode It's good to see you around. I wanted to thank you for everything that you did to create and share this UDF.

I'm not sure if you've followed some of the dark mode changes with Windows 11 25H2 and higher. There are two dark themes in the msstyles/uxtheme which can be selectively applied (with _WinAPI_SetWindowTheme, I mean). There is DarkMode_Explorer as we know but also DarkMode_DarkTheme now.

What I mean by selectively is that you could applied DarkMode_DarkTheme on some controls and DarkMode_Explorer on other controls.

I ran the DarkMode_DarkTheme on all controls of the Sample Controls GUI and it's much better. A lot of the controls that had thick white lines bordering some controls are specifically much better.

I am wondering if it is worth updating the UDF to detect 25H2 and have the ability to use the new dark theme. It's a shame that only 25H2+ users can use it.

Now, while I say the majority of controls with DarkMode_DarkTheme are improved, it is quite possible that some are still being updated. They are still making changes to the aero.msstyles file with almost every monthly release.

Actually I'm pretty sure that 24H2 users got it as well because it's essentially the same kernel and OS as 25H2.

Posted (edited)

Here is a quick example with the Sample Controls:

DarkMode_Explorer (left) and DarkMode_DarkTheme (right)

The Input box is much less blinding on the eyes plus a few others where the lines/borders are thinner and therefore less contrast.

Progress is added with (only 24H2/25H2):

Case 'msctls_progress32'
    $sThemeName = 'DarkMode_CopyEngine'

EDIT: The box showing around the Slider control on both is just the focus rectangle.

image.thumb.png.ebb53f7ee973f59c2a4b51d8618e3103.png

Edited by WildByDesign
Posted

Hi I don't get the same result 

Can you post the GUIDarkMode.au3 you are using for DarkMode_DarkTheme 

Thanks

Posted (edited)
5 minutes ago, jpm said:

Can you post the GUIDarkMode.au3 you are using for DarkMode_DarkTheme 

Absolutely. You just have to run GuiDarkmodeApply($hWnd) with the handle of your GUI and it will run through all of the controls.

GUIDarkMode_v0.02mod.au3

 

EDIT: If you are on a previous version of AutoIt you will need the following:

Global Const $DWMWA_USE_IMMERSIVE_DARK_MODE = (@OSBuild <= 18985) ? 19 : 20

 

Edited by WildByDesign
Posted
4 minutes ago, jpm said:

Just wondering why the header of the listview does not show in white?

That is one thing that was always problematic with dark mode on ListViews. It will make the background of the header dark but the text of the header stays dark which is no good.

For that reason, I have always had to subclass the header for the ListView.

I have always had to do tricks with TreeView/ListView checkboxes as well to show the dark mode variant of those.

Microsoft still has a way to go, but it’s good to finally see them starting to put more resources into dark mode development. I didn’t think it would ever happen.

Posted
6 minutes ago, argumentum said:

Will you share code to show how :baby:

For sure, I will always share anything here. Technically, the subclass code likely came from these forums and I believe was about a decade ago, but still works.

It may need to be modified now though since there seems to be differences between DarkMode_Explorer and DarkMode_DarkTheme for the header.

I am on my iPhone right now but I will post it  in about an hour.

I ran out of my nice Colombian coffee yesterday and it seems to have thrown off my whole routine today. 😱

Posted
17 minutes ago, jpm said:

I found in my old testing on the subject 

I hope it is useful

This looks great and works really well. Thank you so much. This is very helpful.

@argumentum This is significantly better than what I was going to post. Mine used _LVWndProc as well but did not function nearly as well.

 

@NoNameCode By the way, if you haven't seen the awesome dark mode subclassing that @UEZ did recently in this thread, you should check it out. It's definitely the most thorough when it comes to the dark mode subclassing efforts and the final outcome of the dark mode GUI visuals.

Posted

I was thinking that we need to also find a better method to get the dark mode checkboxes to show up in ListViews and TreeViews.

Here is an example of one of my Windows security apps that I made a year or two ago:

image.thumb.png.c115a6755f2ba940eb06c5a6149e8fcc.png

Here is the code that I used to make it:

If $isDarkMode = True Then
    $hImageList = _GUICtrlListView_GetImageList($hCapabilitiesList, 2)
    _GUIImageList_Remove($hImageList)

    If @Compiled = 0 Then
        _GUIImageList_AddIcon($hImageList, "unchecked.ico")
        _GUIImageList_AddIcon($hImageList, "checked.ico")
    Else
        _GUIImageList_AddIcon($hImageList, @ScriptFullPath, 3)
        _GUIImageList_AddIcon($hImageList, @ScriptFullPath, 4)
    EndIf
EndIf

Here are the icons:

checked.icounchecked.ico

The icons are actually created from the built-in Windows dark mode checkbox resources and in the same DPI scaling resolutions.

But that makes me wonder: Is it possible to pull ImageList resources from a checkbox?

If we could pull the resources like that from a created (but hidden) dark mode checkbox, it might be better than having to attach icon files separately to a project.

I am not quite as familiar with TreeView controls, but I would think that we can probably do something similar with ImageLists to get dark mode checkboxes.

Posted
1 hour ago, argumentum said:

Where is the 3rd state of a checkbox ( not checked nor unchecked ) ?, we're gonna need that icon too :) 

Oops. I forgot about that. Is that the one called "tristate" or something like that?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...