Jump to content

Recommended Posts

Posted

GUIDarkTheme 2026.11.11

  • Added dark theme support for UDF-created Edit controls
  • Fixes for Edit controls with $ES_MULTILINE
  • Significant tab control improvements:
    • Rewrote most of the tab control subclass for performance
    • Improved the overall design of the custom tab control
    • Added hover state and hover theming to the non-selected tabs
    • Added slightly rounded corners to tab control display rectangle
    • Using a map instead of EnumChildWindows loop for ExcludeClipRect of controls (performance)
    • Removed prior workaround that modified Z-order of controls in tab control
    • Added caching of control handles detected within tab controls
    • Added item text and image caching
    • All tab control caching supports multiple tab controls
  • UpDown control improvements
    • Added slightly rounded corners to UpDown buttons
    • Performance improvements for UpDown subclass
    • Fixed occasional flicker with UpDown control
  • Fixed crash on x86 AutoIt
  • Theme Hook related fixes and benefits:
    • Fixes 1px white line under dark menubar - removed related subclassing
    • Fixes ListView header text - removed customdraw code
    • Fixes TreeView unfocused selection text color with DarkMode_DarkTheme
    • Can use _WinAPI_GetSysColorBrush for custom dark brushes now
    • Brushes are cached and do not need to be deleted
    • No longer neeed WM_PAINT for _ChooseFont dialog

Latest download available in the first post of the topic. :)

Posted

Tab control not displaying the content

just click on tab4 and after click on left  to display tab3 nothing displayed (x86)

Cheers

Posted

Amazing work first and foremost!

But is it possible to change the accent color of all controls?

 

Spoiler

image.thumb.png.b4914c9a4f7c1f61b86dea1ff40e6437.png

 

Posted

GUIDarkTheme 2026.11.12

  • Improved the way that controls inside tab controls are excluded from being painted over in WM_PAINT
    • Use ExcludeClipRect on entire content display area instead of looping through controls and excluding individually
    • Improved handling of WM_ERASEBKGND to ensure that incorrect background color does not bleed through controls
    • This should improve tab control subclass performance even further while still excluding controls

Latest download available in the first post of the topic. :)

 

6 hours ago, jpm said:

Tab control not displaying the content

just click on tab4 and after click on left  to display tab3 nothing displayed (x86)

Thank you for reporting. I ended up finding a better and faster technique to prevent the controls inside tabs from being painted over. It should make the entire tab control WM_PAINT much faster and more efficient which is always great. :)

Please test this new update and let me know if there are still any controls being painted over.

I tested this new update with Control Viewer which has a large amount of controls per tab and it performed very well.

Posted
5 hours ago, NMS said:

Amazing work first and foremost!

But is it possible to change the accent color of all controls?

Thank you, I appreciate that. :)

I do have the _GUIDarkTheme_AccentColorSet function to change the accent color, but it is only used on a few controls that have selection indicators like the selected Tab, focused Edit controls, etc.

I can probably expand the usage of accent color more if you have some ideas. I was also considering having an option to auto-detect the accent color that the user has set in Windows by default.

Is your screenshot an example of the controls that you want to use the accent color?

Posted
43 minutes ago, WildByDesign said:

Thank you, I appreciate that. :)

I do have the _GUIDarkTheme_AccentColorSet function to change the accent color, but it is only used on a few controls that have selection indicators like the selected Tab, focused Edit controls, etc.

I can probably expand the usage of accent color more if you have some ideas. I was also considering having an option to auto-detect the accent color that the user has set in Windows by default.

Is your screenshot an example of the controls that you want to use the accent color?

Example I provided was basically swapping all the colors that matched to the one I wanted.

A quick overview of what I'm looking for is a way to color all the controls that windows has, regardless of the Windows' default accent color and then apply Mica theme for example. Right now I'm using various other UDF's (such as GUIFlatButton) but all of them have 1 or more drawbacks. And after so long and 30k lines I'm tired of constantly compromising to make my script look even somewhat modern. I've even looked into WebView but that's a whole new can of worms that I would have to learn from scratch to even begin using. And I'm not even sure what its limits are.

So I'm wondering if you know if it's possible to change the accent color of checkboxes for example without changing Windows' theme color?

Posted
4 minutes ago, NMS said:

A quick overview of what I'm looking for is a way to color all the controls that windows has, regardless of the Windows' default accent color and then apply Mica theme for example. Right now I'm using various other UDF's (such as GUIFlatButton)

I used to have Mica support in this UDF and I am thinking about bringing it back. We can’t typically colour buttons. But if Mica is enabled, I can bring back a custom draw button with Mica support that is much better than GuiFlatButton UDF. That UDF creates and uses a child GUI (GUICreate) for each and every button which is not very efficient.

So I can easily add custom buttons back specifically for the case of Mica.

8 minutes ago, NMS said:

So I'm wondering if you know if it's possible to change the accent color of checkboxes for example without changing Windows' theme color?

So the color of the actual check mark and circle for radio buttons and stuff like that?

That is possible but I would need to find the most efficient way to do it. That would take some time. But custom buttons and Mica support I can do pretty quickly.

Posted
4 minutes ago, WildByDesign said:

So the color of the actual check mark and circle for radio buttons and stuff like that?

Correct. For example part of my script has a simple setting to change accent of every control and text that matches specific color. With rich edit control I simply loop through every character and check its color but for certain controls it gets trickier especially if I use subclassing or a layered window. Right now while I have checkboxes that aren't native control, they are simply buttons that check if control has a specific character in it. And a lot of stuff like that is exactly what I'm struggling with when I need to update something. It's far from efficient and my own version of GUIFlatButton UDF is on its 4th revision.

So your UDF right now is the perfect solution for all of the problems except for the accent color part.

Either way, don't worry about it too much. I'll slowly start rolling back all the botching that I did over the years to standard windows controls and from there I'll try implementing your UDF.

Thank you for the amazing work that you're doing!

Posted
31 minutes ago, jpm said:

Better tab display

Thank you for confirming that the controls inside the tabs are not being painted over anymore. That is good news.

32 minutes ago, jpm said:

But when clicking on left the tab is not selected

Can you please describe this in more detail?

I am not sure if you mean clicking left Spin control button, left key for keyboard navigation or simply a left mouse click on tab item.

I would like to fix it but I want to reproduce it so that I know exactly the problem. 

Posted

when clicking ithe tab is put back for insntance when on tab 4 tab 3 appear but nothing inside if the tab tab 3 is click to slectect it the tab is drawn

why the content is not drawn directly

 

Posted (edited)

Hello :)
If I understood correctly (which is not sure at all) @jpm would like to change the client area content of the Tab control when clicking on the arrows of the horizontal internal updown control. It seems that it is not a native Windows behavior, as only the left/right keys of the keyboard allow this (or a direct click on a tab of course).

I asked Google to code a script that could uniformize this, making the mouse clicks on the horizontal updown control behave exactly as the keyboard left/right keys, which may be useful in the future.

The following comment and the script were both generated by Google AI

========================

To clarify the situation :

1. Why the tab appeared empty: By native Windows design, clicking the internal UpDown/Spin control (msctls_updown32) of a SysTabControl32 only scrolls the tab headers—it does not change the active selection or send TCN_SELCHANGE (unlike using the left/right keyboard arrows). If you were previously on an empty tab (like TabItem4 in the example) and clicked the left Spin arrow, TabItem3 scrolls back into view while TabItem4 remains the active tab, leaving the client area blank until you explicitly click on TabItem3.

2. How to unify Spin clicks with keyboard arrows: Since the Tab control is already subclassed, you can intercept WM_NOTIFY with $UDN_DELTAPOS inside the Tab subclass procedure and call _GUICtrlTab_SetCurFocus(). This makes the Spin arrows behave identically to the left/right keyboard arrows (automatically updating the visible controls via AutoIt's internal tab handling).

Here is a standalone reproduction/solution script :

#include <GUIConstantsEx.au3>
#include <GuiTab.au3>
#include <WinAPIShellEx.au3>
#include <WindowsConstants.au3>

Opt("MustDeclareVars", 1)

Global Const $UDN_FIRST = -721
Global Const $UDN_DELTAPOS = $UDN_FIRST - 1

Global $g_hTab, $g_hTabProc

Example()

Func Example()
    Local $hGUI = GUICreate("Test Tab Spin = Keyboard", 250, 150)

    Local $idTab = GUICtrlCreateTab(10, 10, 230, 130)
    $g_hTab = GUICtrlGetHandle($idTab)

    For $i = 0 To 3
        GUICtrlCreateTabItem("TabItem" & $i)
        GUICtrlCreateButton("Button " & $i, 30, 60, 100, 30)
    Next

    GUICtrlCreateTabItem("TabItem4")
    GUICtrlCreateTabItem("")

    $g_hTabProc = DllCallbackRegister("_TabSubclassProc", "lresult", "hwnd;uint;wparam;lparam;uint_ptr;dword_ptr")
    _WinAPI_SetWindowSubclass($g_hTab, DllCallbackGetPtr($g_hTabProc), 1, 0)

    GUISetState(@SW_SHOW, $hGUI)

    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                ExitLoop
        EndSwitch
    WEnd

    _WinAPI_RemoveWindowSubclass($g_hTab, DllCallbackGetPtr($g_hTabProc), 1)
    DllCallbackFree($g_hTabProc)
    GUIDelete($hGUI)
EndFunc   ;==>Example

Func _TabSubclassProc($hWnd, $iMsg, $wParam, $lParam, $uIdSubclass, $dwRefData)
    If $iMsg = $WM_NOTIFY Then
        Local $tNMHDR = DllStructCreate($tagNMHDR, $lParam)
        If DllStructGetData($tNMHDR, "Code") = $UDN_DELTAPOS Then
            ; NMUPDOWN structure: NMHDR + int iPos + int iDelta
            Local $tNMUPDOWN = DllStructCreate($tagNMHDR & ";int iPos;int iDelta", $lParam)
            Local $iDelta = DllStructGetData($tNMUPDOWN, "iDelta")

            ; 1. Let the Tab control scroll the tab headers visually first
            Local $lRet = _WinAPI_DefSubclassProc($hWnd, $iMsg, $wParam, $lParam)

            ; 2. Calculate the new index (iDelta is negative for left, positive for right)
            Local $iCount = _GUICtrlTab_GetItemCount($hWnd)
            Local $iCurSel = _GUICtrlTab_GetCurSel($hWnd)
            Local $iNewSel = $iCurSel + ($iDelta < 0 ? -1 : 1)

            If $iNewSel >= 0 And $iNewSel < $iCount Then
                _GUICtrlTab_SetCurFocus($hWnd, $iNewSel)
            EndIf

            Return $lRet
        EndIf
    EndIf

    Return _WinAPI_DefSubclassProc($hWnd, $iMsg, $wParam, $lParam)
EndFunc   ;==>_TabSubclassProc

 

 

Edited by pixelsearch
1 variable renamed

"I think you are searching a bug where there is no bug... don't listen to bad advice."

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...