Last active
July 13, 2024 09:44
-
-
Save Olikonsti/879edbf69b801d8519bf25e804cec0aa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ctypes as ct | |
def dark_title_bar(window): | |
""" | |
MORE INFO: | |
https://docs.microsoft.com/en-us/windows/win32/api/dwmapi/ne-dwmapi-dwmwindowattribute | |
""" | |
window.update() | |
DWMWA_USE_IMMERSIVE_DARK_MODE = 20 | |
set_window_attribute = ct.windll.dwmapi.DwmSetWindowAttribute | |
get_parent = ct.windll.user32.GetParent | |
hwnd = get_parent(window.winfo_id()) | |
rendering_policy = DWMWA_USE_IMMERSIVE_DARK_MODE | |
value = 2 | |
value = ct.c_int(value) | |
set_window_attribute(hwnd, rendering_policy, ct.byref(value), ct.sizeof(value)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thank you for sharing @SarthakTools https://github.com/Akascape/py-window-styles