Jump to content

GUI Dark Mode Windows 10 possible ?


Recommended Posts

Is it simply possible to have the Dark Mode enable on a GUI ?

#include <ColorConstants.au3>
#include <GUIConstantsEx.au3>
#include <WinAPITheme.au3>
#include <Array.au3>


Func Example()
    Local $hGUI = GUICreate("Example", 300, 200)
    $sTheme = "DarkMode_Explorer"
    ;Local $tString = DllStructCreate ("char[" & StringLen ($sTheme) & "]")
    ;DllStructSetData ($tString, 1, $sTheme)
    ; Local $aRet = DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", $hGUI, "ptr", DllStructGetPtr($tString), "ptr", Null)
    ;_ArrayDisplay ($aRet)

    ;$hCheckbox = GUICtrlCreateCheckbox("Text with colour change", 10, 10, 150, 20)
    ;   GUICtrlSetColor($hCheckbox, $COLOR_RED)

    Local $idButton_Close = GUICtrlCreateButton("Close", 210, 170, 85, 25)

    ConsoleWrite(_WinAPI_SetWindowTheme($hGUI, $sTheme) & @CRLF)


    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE, $idButton_Close
EndFunc   ;==>Example


Link to comment
Share on other sites

  • 3 years later...

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...