{"id":14976999,"url":"https://github.com/zingzy/hpyt","last_synced_at":"2026-03-05T10:03:42.874Z","repository":{"id":190186025,"uuid":"682135613","full_name":"Zingzy/hPyT","owner":"Zingzy","description":"A package to manipulate Windows and Title Bars of GUI applications made using Python","archived":false,"fork":false,"pushed_at":"2025-09-18T06:25:59.000Z","size":24809,"stargazers_count":124,"open_issues_count":6,"forks_count":12,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-09-28T05:02:32.063Z","etag":null,"topics":["customtkinter","kivy","pygame","pyqt5","pyside2","pyside6","pysimplegui","python","python-3","python-app","python-gui","python-gui-tkinter","python-titlebar","python3","titlebar","titlebar-customization","tkinter","windows-10","windows-11","wxpython"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/hPyT","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Zingzy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-08-23T14:13:55.000Z","updated_at":"2025-09-22T05:29:53.000Z","dependencies_parsed_at":"2024-05-12T17:22:57.249Z","dependency_job_id":"e60fecae-c1c6-49a2-9c6d-5234df461dda","html_url":"https://github.com/Zingzy/hPyT","commit_stats":{"total_commits":101,"total_committers":7,"mean_commits":"14.428571428571429","dds":"0.15841584158415845","last_synced_commit":"1a710e60410fe89c34819efb5eb1bad6441a6509"},"previous_names":["zingzy/hpyt"],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/Zingzy/hPyT","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zingzy%2FhPyT","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zingzy%2FhPyT/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zingzy%2FhPyT/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zingzy%2FhPyT/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Zingzy","download_url":"https://codeload.github.com/Zingzy/hPyT/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zingzy%2FhPyT/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30118932,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T09:35:22.236Z","status":"ssl_error","status_checked_at":"2026-03-05T09:35:20.028Z","response_time":93,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["customtkinter","kivy","pygame","pyqt5","pyside2","pyside6","pysimplegui","python","python-3","python-app","python-gui","python-gui-tkinter","python-titlebar","python3","titlebar","titlebar-customization","tkinter","windows-10","windows-11","wxpython"],"created_at":"2024-09-24T13:54:49.248Z","updated_at":"2026-03-05T10:03:42.861Z","avatar_url":"https://github.com/Zingzy.png","language":"Python","readme":"# hPyT - Hack Python Titlebar\n\nA package for manipulating windows and titlebar of GUI applications made using Python. Supports Windows 7, 8.x, 10, and 11.\n\nhttps://github.com/Zingzy/hPyT/assets/90309290/f86df1c7-b75b-4477-974a-eb34cc117df3\n\n\u003cbr\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e📖 Table of Contents\u003c/summary\u003e\n\n- [hPyT - Hack Python Titlebar](#hpyt---hack-python-titlebar)\n\t- [📚 Supported Libraries](#-supported-libraries)\n\t- [📦 Installing](#-installing)\n\t- [🧩 Running the preview app](#-running-the-preview-app)\n\t- [📥 Importing](#-importing)\n\t- [NEW Features in `v1.4.0` 🎉](#new-features-in-v140-)\n\t- [Hide/Unhide TitleBar](#hideunhide-titlebar)\n\t\t\t- [**Understanding Window Geometry**](#understanding-window-geometry)\n\t\t- [**Impact of Hiding the Title Bar**](#impact-of-hiding-the-title-bar)\n\t\t- [**Potential Issues**](#potential-issues)\n\t\t- [**Solution**](#solution)\n\t\t- [Example Usage](#example-usage)\n\t\t- [Comparision of the dimensions with and without `no_span=True`:](#comparision-of-the-dimensions-with-and-without-no_spantrue)\n\t\t- [Visual Example:](#visual-example)\n\t- [🌈 Rainbow TitleBar](#-rainbow-titlebar)\n\t- [🌈 Rainbow Border](#-rainbow-border)\n\t\t- [🔄 Synchronizing the Rainbow Effect with other elements](#-synchronizing-the-rainbow-effect-with-other-elements)\n\t- [Hide/Unhide both Maximize and Minimize Buttons (Completely Hides both buttons)](#hideunhide-both-maximize-and-minimize-buttons-completely-hides-both-buttons)\n\t- [Hide/Unhide All Buttons or Stuffs](#hideunhide-all-buttons-or-stuffs)\n\t- [Enable/Disable Maximize Button](#enabledisable-maximize-button)\n\t- [Enable/Disable Minimize Button](#enabledisable-minimize-button)\n\t- [🎨 Custom TitleBar Color](#-custom-titlebar-color)\n\t\t- [Set TitleBar Color to Windows Accent Color](#set-titlebar-color-to-windows-accent-color)\n\t- [🖌️ Custom TitleBar Text Color](#️-custom-titlebar-text-color)\n\t- [🖌️ Custom Border Color](#️-custom-border-color)\n\t\t- [Set Border Color to Windows Accent Color](#set-border-color-to-windows-accent-color)\n\t- [Window Corner Radius](#window-corner-radius)\n\t- [Window DWM Manipulation](#window-dwm-manipulation)\n\t\t- [Enable RTL Layout for the DWM Window](#enable-rtl-layout-for-the-dwm-window)\n\t\t- [Disable DWM Transitions for the DWM Window](#disable-dwm-transitions-for-the-dwm-window)\n\t\t- [Window Cloaking](#window-cloaking)\n\t\t\t- [Example of window rendering with and without cloacking](#example-of-window-rendering-with-and-without-cloacking)\n\t- [Opacity](#opacity)\n\t- [⚡ Flashing Window](#-flashing-window)\n\t- [💻 Window Management](#-window-management)\n\t\t- [Center a window on the screen](#center-a-window-on-the-screen)\n\t\t- [Center a secondary window relative to the primary window](#center-a-secondary-window-relative-to-the-primary-window)\n\t\t- [Other basic window management functions](#other-basic-window-management-functions)\n\t- [✨ Window Animations](#-window-animations)\n\t\t- [Circle Motion](#circle-motion)\n\t\t- [Verical Shake](#verical-shake)\n\t\t- [Horizontal Shake](#horizontal-shake)\n\t- [✏️ Stylize text](#️-stylize-text)\n\t- [Workaround for other libraries](#workaround-for-other-libraries)\n\t- [Miscellaneous](#miscellaneous)\n\t\t- [Get Windows Accent Color](#get-windows-accent-color)\n\t\t- [Stylize text](#stylize-text)\n\t- [📜 hPyT Changelog](#-hpyt-changelog)\n\t\t- [v1.4.0](#v140)\n\t\t- [v1.3.7](#v137)\n\t\t- [v1.3.6](#v136)\n\t\t- [v1.3.5](#v135)\n\t\t- [v1.3.4](#v134)\n\t\t- [v1.3.3](#v133)\n\t\t- [v1.3.2](#v132)\n\t\t- [v1.3.1](#v131)\n\t\t- [v1.3.0](#v130)\n\t\t- [v1.2.1](#v121)\n\t\t- [v1.2.0](#v120)\n\t\t- [v1.1.3](#v113)\n\t\t- [v1.1.2](#v112)\n\t\t- [v1.1.1](#v111)\n\t\t- [v1.1.0](#v110)\n\u003c/details\u003e\n\n---\n\n## 📚 Supported Libraries\n\n- Tkinter \u0026 CustomTkinter\n- PyQt\n- PySide\n- WxPython\n- Kivy\n- Almost all other UI libraries\n  \n\u003e [!IMPORTANT]\n\u003e Follow [this section](#workaround-for-other-libraries) to see how to use hPyT with other libraries.\n\n## 📦 Installing\n\n```powershell\npip install hPyT==1.4.0\n```\n\n## 🧩 Running the preview app\n\nAfter installing the module, you can run the following command to open the preview/demo app:\n\n```powershell\npython -m hPyT\n```\n\n...or try this even simpler command (if it doesn't work, check if your Python installation's `Scripts` folder exists in your `PATH` environment variable):\n\n```powershell\nhPyT-preview\n```\n\nIt looks like this:\n\n![Preview app screenshot](preview_app_screenshot.png)\n\nThis app allows you to play with hPyT's features and see them in action.\n\n## 📥 Importing\n\n```python\nfrom hPyT import *\nfrom customtkinter import * # you can use any other library from the above mentioned list\n\nwindow = CTk() # creating a window using CustomTkinter\n```\n\n## NEW Features in `v1.4.0` 🎉\n\n- Function to change `corner radius` of the window with the [`hPyT.corner_radius`](#window-corner-radius) module \n- Functions to manipulate `DWM` window attributes with the [`hPyT.window_dwm`](#window-dwm-manipulation) module\n   - Enable **RTL layout**\n   - Disable **DWM transitions**\n   - Cloak the window\n\n## Hide/Unhide TitleBar\n\n```python\ntitle_bar.hide(window, no_span = False) # hides full titlebar\n# optional parameter : no_span, more details in the note below\n# title_bar.unhide(window)\n```\n\n| Parameter | Type | Default | Description |\n| :-------: | :--: | :-----: | :----------: |\n| `no_span` | `bool` | `False` | If `True`, the content area height will not be adjusted to accommodate the title bar. |\n\n![Hide Titlebar preview](https://raw.githubusercontent.com/zingzy/hPyT/main/.github/assets/titlebar.png)\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003ch3\u003e❗Important Note when hiding the titlebar and using \u003ccode\u003eno_span\u003c/code\u003e parameter\u003c/h3\u003e\u003c/summary\u003e\n\nWhen hiding a title bar, the application window's total geometry and its content area geometry behave differently, which may introduce ambiguities. Here's a detailed explanation of the issue:\n\n#### **Understanding Window Geometry**\n\n1. **Full Window Dimensions**:\n   - Includes the content area, title bar, and borders.\n   - When the user specifies dimensions (e.g., `400x400`), it usually represents the **content area dimensions**. The total window height becomes `content height + title bar height + border width`.\n   - The color of the `top border` and `title bar` is usually the same in **Windows 11 \u0026 10**, making it appear as a single entity. So when hiding the title bar, we also need to hide the top border.\n   - However, in **Windows 7 \u0026 8**, the top border is a different color from the title bar, so we don't need to hide the top border when hiding the title bar. Moreover removing the top border will make the window behave abnormally in these versions.\n\n2. **Content Area Dimensions**:\n   - Represents only the usable area inside the window, excluding the title bar and borders.\n\n### **Impact of Hiding the Title Bar**\n\nWhen the title bar is hidden:\n- The **content area height** expands to occupy the height previously used by the title bar. For example, a `400x400` content area might expand to `400x438` (assuming the visual title bar height is 38px).\n\nBetter illustrated in the following example:\n\n```python\n...\n\ndef show_window_dimensions():\n    hwnd: int = ctypes.windll.user32.GetForegroundWindow()\n\n    x_with_decorations: int = root.winfo_rootx()  # X position of the full window\n    y_with_decorations: int = root.winfo_rooty()  # Y position of the full window\n\n    x_without_decorations: int = root.winfo_x()  # X position of the content area\n    y_without_decorations: int = root.winfo_y()  # Y position of the content area\n\n    titlebar_height: int = y_with_decorations - y_without_decorations\n    border_width: int = x_with_decorations - x_without_decorations\n\n    window_rect: RECT = get_window_rect(hwnd)\n\n    width: int = window_rect.right - window_rect.left\n    height: int = window_rect.bottom - window_rect.top\n\n    print(f\"Title bar height: {titlebar_height}\")\n    print(f\"Border width: {border_width}\")\n    print(f\"Main window dimensions: {width}x{height}\")\n    print(\n        f\"Content window dimensions: {root.winfo_geometry()}\"\n    )  # This will return the dimensions of the content area only\n\n...\n\ndef click(e=None):\n    root.update_idletasks()\n\n    print(\"------ Before hiding title bar ------\")\n    show_window_dimensions()\n\n\ttitle_bar.hide(root)\n\tis_hidden = True\n\n    print(\"------ After hiding title bar ------\")\n    show_window_dimensions()\n\n\nbutton = CTkButton(root, text=\"Click Me\", command=click)\nbutton.place(relx=0.5, rely=0.5, anchor=\"center\")\n\nroot.mainloop()\n```\n\nOutput:\n\n```cmd\n------ Before hiding title bar ------\nTitle bar height: 38\nBorder width: 9\nMain window dimensions: 468x497\nContent window dimensions: 450x450\n------ After hiding title bar ------\nTitle bar height: 0\nBorder width: 9\nMain window dimensions: 468x497\nContent window dimensions: 450x488\n```\n\nBy the above example, you can see that the content area height has increased from `450px` to `488px` after hiding the title bar.\n\n### **Potential Issues**\nThis automatic resizing may cause layout problems or unintended behavior in some applications. For instance:\n- UI elements might **overlap** or **stretch**.\n- Custom layouts may require recalibration.\n\n### **Solution**\nTo address this, a `no_span` parameter is introduced in the `hide` method. This parameter allows users to control whether the content area height should be adjusted dynamically to maintain its original size.\n\n- **Default Behavior (`no_span=False`)**:\n  The content area height will expand to occupy the title bar's space.\n- **With `no_span=True`**:\n  The content area will be resized dynamically to maintain its original dimensions.\n\n### Example Usage\n\n```python\ntitle_bar.hide(root, no_span=True)\n```\n\n### Comparision of the dimensions with and without `no_span=True`:\n\n```diff\n- Content window dimensions: 450x488\n+ Content window dimensions: 450x450\n\n- Main window dimensions: 468x497\n+ Main window dimensions: 468x459\n```\n\n### Visual Example:\n\n\u003cdiv align=\"center\"\u003e\n\n| `no_span = False` | `no_span = True` |\n| :---------------: | :--------------: |\n| \u003cimg src=\"https://raw.githubusercontent.com/Zingzy/hPyT/main/.github/assets/span.gif\" alt=\"Height of the Content area changes when the no_span paramer is set to False by default\" width=300\u003e | \u003cimg src=\"https://raw.githubusercontent.com/Zingzy/hPyT/main/.github/assets/no_span.gif\" alt=\"Height of the Content area does not change when the no_span paramer is set to False by default\" width=300\u003e |\n\n\u003c/div\u003e\n\n---\n\n\u003c/details\u003e\n\n## 🌈 Rainbow TitleBar\n\nThis feature is only supported on Windows 11.\n\n```python\nrainbow_title_bar.start(window, interval=5) # starts the rainbow titlebar\n# rainbow_title_bar.stop(window) # stops the rainbow titlebar\n```\n\n| Parameter | Type | Default | Description |\n| :-------: | :--: | :-----: | :----------: |\n| `interval` | `int` | `5` | The time in milliseconds in which the color would change. |\n| `color_stops` | `int` | `5` | The number of color stops between each RGB value. |\n\n![Rainbow TitleBar](https://raw.githubusercontent.com/zingzy/hPyT/main/.github/assets/rainbow_titlebar.gif)\n\n## 🌈 Rainbow Border\n\nThis feature is only supported on Windows 11.\n\n```python\nrainbow_border.start(window, interval=4) # starts the rainbow border\n# rainbow_border.stop(window) # stops the rainbow border\n```\n\n| Parameter | Type | Default | Description |\n| :-------: | :--: | :-----: | :----------: |\n| `interval` | `int` | `5` | The time in milliseconds in which the color would change. |\n| `color_stops` | `int` | `5` | The number of color stops between each RGB value. |\n\n![Rainbow Border](https://raw.githubusercontent.com/zingzy/hPyT/main/.github/assets/rainbow_border.gif)\n\n### 🔄 Synchronizing the Rainbow Effect with other elements\n\n```python\nfrom hPyT import *\n\n...\n\nrainbow_title_bar.start(window, interval=30) # starts the rainbow titlebar\n# rainbow_border.start(window, interval=30) # also works with rainbow border\n\ncurrent_color = rainbow_title_bar.get_current_color() # or rainbow_border.get_current_color()\n# you can use this color to synchronize the color of other elements with the titlebar\n```\n\n![synchronization example](https://raw.githubusercontent.com/zingzy/hPyT/main/.github/assets/synchronization-example.gif)\n\n\n**Code for the above illustration available in [`/examples/rainbow-synchronization-example.py`](https://github.com/Zingzy/hPyT/blob/main/examples/rainbow-synchronization-example.py)**\n\n\n## Hide/Unhide both Maximize and Minimize Buttons (Completely Hides both buttons)\n\n```python\nmaximize_minimize_button.hide(window) # hides both maximize and minimize button\n# maximize_minimize_button.unhide(window)\n```\n\n![Hidden Maximize and Minimize Buttons](https://raw.githubusercontent.com/zingzy/hPyT/main/.github/assets/maximize_minimize.png)\n\n## Hide/Unhide All Buttons or Stuffs\n\n```python\nall_stuffs.hide(window) # hides close button\n# all_stuffs.unhide(window)\n```\n\n![Hide Everything](https://raw.githubusercontent.com/zingzy/hPyT/main/.github/assets/all_stuffs.png)\n\n\u003e [!TIP]\n\u003e To hide the text, set the window title to `''`.\n\n## Enable/Disable Maximize Button\n\n```python\nmaximize_button.disable(window) # hides maximize button\n# MaximizeButton.enable(window)\n```\n\n![Disabled Maximize Button](https://raw.githubusercontent.com/zingzy/hPyT/main/.github/assets/maximize.png)\n\n## Enable/Disable Minimize Button\n\n```python\nminimize_button.disable(window) # hides minimize button\n# MinimizeButton.enable(window)\n```\n\n![Disabled Minimize Button](https://raw.githubusercontent.com/zingzy/hPyT/main/.github/assets/minimize.png)\n\n## 🎨 Custom TitleBar Color\n\nThis feature is only supported on Windows 11.\n\n```python\ntitle_bar_color.set(window, color='#ff00ff') # sets the titlebar color to magenta\n# title_bar_color.reset(window) # resets the titlebar color to default\n```\n\n| Parameter | Type | Default | Description |\n| :-------: | :--: | :-----: | :----------: |\n| `color` | `Union[str, Tuple[int]]` | ❌ | The color to set the titlebar to in either Hex (string) or RGB (tuple of integers) format |\n\n\n![Custom TitleBar Color](https://raw.githubusercontent.com/zingzy/hPyT/main/.github/assets/titlebar_color.png)\n\n### Set TitleBar Color to Windows Accent Color\n\n```python\ntitle_bar_color.set_accent(window) # sets the titlebar color to the current Windows accent color\n```\n\n![Accent TitleBar](https://raw.githubusercontent.com/zingzy/hPyT/main/.github/assets/accent_titlebar.png)\n\n\u003e [!NOTE]\n\u003e The titlebar color will automatically change when the Windows accent color changes\n\n## 🖌️ Custom TitleBar Text Color\n\nThis feature is only supported on Windows 11.\n\n```python\ntitle_bar_text_color.set(window, color='#ff00ff') # sets the titlebar text color to magenta\n# title_bar_text_color.reset(window) # resets the titlebar text color to default\n```\n\n| Parameter | Type | Default | Description |\n| :-------: | :--: | :-----: | :----------: |\n| `color` | `Union[str, Tuple[int]]` | ❌ | The color to set the titlebar text to in either Hex (string) or RGB (tuple of integers) format |\n\n![Custom TitleBar Text Color](https://raw.githubusercontent.com/zingzy/hPyT/main/.github/assets/title_text_color.png)\n\n## 🖌️ Custom Border Color\n\nThis feature is only supported on Windows 11.\n\n```python\nborder_color.set(window, color='#ff00ff') # sets the border color to magenta\n# border_color.reset(window) # resets the border color to default\n```\n\n| Parameter | Type | Default | Description |\n| :-------: | :--: | :-----: | :----------: |\n| `color` | `Union[str, Tuple[int]]` | ❌ | The color to set the border to in either Hex (string) or RGB (tuple of integers) format |\n\n![Custom Border Color](https://raw.githubusercontent.com/zingzy/hPyT/main/.github/assets/border_color.png)\n\n### Set Border Color to Windows Accent Color\n\n```python\nborder_color.set_accent(window) # sets the border color to the current Windows accent color\n```\n\n![Accent Border](https://raw.githubusercontent.com/zingzy/hPyT/main/.github/assets/accent_border.png)\n\n\u003e [!NOTE]\n\u003e The border color will automatically change when the Windows accent color changes.\n\n## Window Corner Radius\n\nThis feature is only supported on Windows 11.\n\n```python\ncorner_radius.set(window, style=\"round-small\") # sets the window border radius to round-small\n# corner_radius.reset(window) # resets the window border radius to default\n```\n\n**List of available styles**:\n\n\u003cdiv align=\"center\"\u003e\n\n| Style | Preview |\n| :---: | :---: |\n| `round-small` | \u003cimg src=\"https://raw.githubusercontent.com/zingzy/hPyT/main/.github/assets/corner_small_round.png\" alt=\"Round-small\" width=400\u003e |\n| `square` | \u003cimg src=\"https://raw.githubusercontent.com/zingzy/hPyT/main/.github/assets/corner_square.png\" alt=\"Square\" width=400\u003e |\n| `round` | \u003cimg src=\"https://raw.githubusercontent.com/zingzy/hPyT/main/.github/assets/corner_round.png\" alt=\"Round\" width=400\u003e |\n\n\u003c/div\u003e\n\n\u003e [!WARNING]\n\u003e The `round-small` option removes the window's shadow, unlike the other options.\n\n## Window DWM Manipulation\n\n`DWM` - **Desktop Window Manager** is the component of a window which controls `non-client area of the window`. The features below are generally used to improve the **accessibility** of a window.\n\n### Enable RTL Layout for the DWM Window\n\n```python\nwindow_dwm.toggle_rtl_layout(window, enabled=True) # enables RTL layout for the window\n# window_dwm.toggle_rtl_layout(window, enabled=False) # disables RTL layout for the window\n```\n\n![RTL Layout](https://raw.githubusercontent.com/zingzy/hPyT/main/.github/assets/dwm_rtl.png)\n\n\u003e [!NOTE]\n\u003e This feature enables the **RTL layout** for the **non-client area** of the window which includes the **titlebar**, **border**, etc.\n\n### Disable DWM Transitions for the DWM Window\n\nDisabling DWM Transitions will make the animations for minimize, maximize, restore, etc. more snappy and faster.\n\n```python\nwindow_dwm.toggle_dwm_transitions(window, enabled=False) # disables DWM transitions for the window\n# window_dwm.toggle_dwm_transitions(window, enabled=True) # enables DWM transitions for the window\n```\n\n\u003cdiv align=\"center\"\u003e\n\n| DWM Transitions `Disabled` | DWM Transitions `Enabled` |\n| :----------------------: | :---------------------: |\n| ![DWM Transitions Disabled](https://raw.githubusercontent.com/zingzy/hPyT/main/.github/assets/dwm_transitions_disabled.gif) | ![DWM Transitions Enabled](https://raw.githubusercontent.com/zingzy/hPyT/main/.github/assets/dwm_transitions_enabled.gif) |\n\n\u003c/div\u003e\n\n\u003e [!NOTE]\n\u003e This will only affect the minimize, maximize, restore, etc. animations. It will not affect custom animations.\n\n\u003e [!IMPORTANT]\n\u003e This feature won't work if the global animations are disabled by the user in the Windows settings.\n\n### Window Cloaking\n\nIf window cloaking is enabled, the window will be hidden while still being composed by DWM i.e the window will be rendered but it will not be visible to the user. \n\n```python\nwindow_dwm.toggle_cloak(window, enabled=True) # hides the window\n\n# Do complex taks like rendering window widgets\n\nwindow_dwm.toggle_cloak(window, enabled=False) # shows the window\n```\n\n\u003e [!TIP]\n\u003e By cloaking a window, `DWM` can optimize the **rendering process** since it doesn't have to display the window's content on the screen. This can help **improve the performance** of applications, especially those with complex UI elements or animations.\n\n#### Example of window rendering with and without cloaking\n\n\u003cdiv align=\"center\"\u003e\n\n| Cloacking Used | Cloacking Not Used |\n| :------------: | :---------------: |\n| ![Cloacking Used](https://raw.githubusercontent.com/zingzy/hPyT/main/.github/assets/dwm_cloak_example.gif) | ![Cloacking Not Used](https://raw.githubusercontent.com/zingzy/hPyT/main/.github/assets/dwm_no_cloak_example.gif) |\n\n\u003c/div\u003e\n\n## Opacity\n\n```python\nopacity.set(window, opacity=0.5) # sets the window opacity to 50%\n# opacity.set(window, opacity=1.0) # resets the window opacity to 100%\n```\n\n| Parameter | Type | Default | Description |\n| :-------: | :--: | :-----: | :----------: |\n| `opacity` | `float` | ❌ | The opacity to set the window to. It should be a value between 0 (**transparent**) and 1.0 (**opaque**). |\n\n![Opacity 0.5 preview](https://raw.githubusercontent.com/zingzy/hPyT/main/.github/assets/opacity.png)\n\n## ⚡ Flashing Window\n\n```python\nwindow_flash.flash(window, count=10, interval=100) # flashes the window 10 times with 100ms interval\n# window_flash.stop(window) # stops the flashing immediately\n```\n\n| Parameter | Type | Default | Description |\n| :-------: | :--: | :-----: | :----------: |\n| `count` | `int` | `5` | The number of times the window will flash. |\n| `interval` | `int` | `1000` | The time in milliseconds in which the window will flash. |\n\n![Flashing Window](https://raw.githubusercontent.com/zingzy/hPyT/main/.github/assets/flashing.gif)\n\n## 💻 Window Management\n\n### Center a window on the screen\n\n```python\nwindow_frame.center(window)\n```\n\n### Center a secondary window relative to the primary window\n\n```python\nwindow_frame.center_relative(window, child_window)\n```\n\n![Center Relative](https://raw.githubusercontent.com/zingzy/hPyT/main/.github/assets/center_relative.png)\n\n**Example Usecase**\n\n```python\nwindow = CTk()\nwindow.title(\"Primary Window\")\nwindow.geometry('600x300')\nwindow_frame.center(window)\n\nchild_window = CTkToplevel()\n\nwindow_frame.center_relative(window, child_window)\n\nwindow.bind(\"\u003cConfigure\u003e\", lambda event: window_frame.center_relative(window, child_window))\n\ndef on_close():  # this is required to stop the window from centering the child window after the parent window is closed\n\twindow.unbind(\"\u003cConfigure\u003e\")\n\tchild_window.destroy()\n\nchild_window.protocol(\"WM_DELETE_WINDOW\", on_close)\n\nwindow.mainloop()\n```\n\n![Center Relative Example](https://raw.githubusercontent.com/zingzy/hPyT/main/.github/assets/center_relative_example.gif)\n\n### Other basic window management functions\n\n```python\nwindow_frame.move(window, 100, 100) # moves the window to (100, 100)\nwindow_frame.resize(window, 500, 500) # resizes the window to 500x500\nwindow_frame.maximize(window) # maximizes the window\nwindow_frame.minimize(window) # minimizes the window\nwindow_frame.restore(window) # restores the window\n```\n\n## ✨ Window Animations\n\n### Circle Motion\n\n```python\nwindow_animation.circle_motion(window, count=5, interval=5, radius=30)\n# moves the window in a circular motion 5 times with 5ms interval and 30px radius\n```\n\n| Parameter | Type | Default | Description |\n| :-------: | :--: | :-----: | :----------: |\n| `count` | `int` | `5` | The number of times the window will move in a circular motion. |\n| `interval` | `int` | `5` | The time in milliseconds in which the window will move in a circular motion. |\n| `radius` | `int` | `20` | The radius of the circular motion. |\n\n![Circle Motion](https://raw.githubusercontent.com/zingzy/hPyT/main/.github/assets/circle_motion.gif)\n\n*The animation might appear a bit fasterer and rougher in the above preview gif than it is*\n\n### Verical Shake\n\n```python\nwindow_animation.vertical_shake(window, count=5, interval=5, amplitude=20)\n# shakes the window vertically 5 times with 5ms interval and 10px distance\n```\n\n| Parameter | Type | Default | Description |\n| :-------: | :--: | :-----: | :----------: |\n| `count` | `int` | `5` | The number of times the window will shake vertically. |\n| `interval` | `int` | `5` | The time in milliseconds in which the window will shake vertically. |\n| `amplitude` | `int` | `20` | The distance the window will shake vertically. |\n\n### Horizontal Shake\n\n```python\nwindow_animation.horizontal_shake(window, count=5, interval=5, amplitude=20)\n# shakes the window horizontally 5 times with 5ms interval and 10px distance\n```\n\n| Parameter | Type | Default | Description |\n| :-------: | :--: | :-----: | :----------: |\n| `count` | `int` | `5` | The number of times the window will shake horizontally. |\n| `interval` | `int` | `5` | The time in milliseconds in which the window will shake horizontally. |\n| `amplitude` | `int` | `20` | The distance the window will shake horizontally. |\n\n## ✏️ Stylize text\n\n```python\ntitle_text.stylize(window, style=1)\n```\n\n**Choose any style from 1 to 10.**\n\n*Below is a gif demonstrating all of the available styles*\n\n![Stylize Text](https://raw.githubusercontent.com/zingzy/hPyT/main/.github/assets/stylize_text.gif)\n\n\u003e [!NOTE]\n\u003e It is recommended to use the `title_text.set` function to change the title of the window instead of directly setting the title of the window.\n\u003e \n\u003e This is because the `title_text.set` function also caches the original title and the styled title so that it can be used to verify the consistency of the title before applying the style.\n\n## Workaround for other libraries\n\nThis menthod is applicable for any other UI library like \u003ckbd\u003epygame\u003c/kbd\u003e \u003ckbd\u003epySimpleGUI\u003c/kbd\u003e, etc. which are not mentioned in the [supported libraries list](#-supported-libraries). You just need to pass the `hwnd` of the window instead of the `window object` to the functions as demonstrated below.\n\n```python\nimport tkinter as tk\nfrom hPyT import *\nimport ctypes\n\n# make sure that the window has been created and is active\n\nhwnd = ctypes.windll.user32.GetActiveWindow()\nrainbow_border.start(hwnd, interval=4) # use the hwnd of the window instead of the window object\n```\n\n[Back to top](#-installing)\n\n## Miscellaneous\n\n### Get Windows Accent Color\n\n```python\nprint(get_accent_color()) # prints the current windows accent color\n\u003e\u003e\u003e '#1b595a'\n```\n\n### Stylize text\n\n```python\nprint(stylize_text(\"Your Custom Text\", style=1)) # stylizes your text\n# all of the styles shown on the above gif are available\n\u003e\u003e\u003e \"𝔜𝔬𝔲𝔯 ℭ𝔲𝔰𝔱𝔬𝔪 𝔗𝔢𝔵𝔱\"\n```\n\n\u003cbr\u003e\n\n## 📜 hPyT Changelog\n\n### v1.4.0\n\n- Add new feature for customizing the corner radius of the window\n- Add new feature for manipulating the non-client area of the window\n- Fix the issue with stylize text not looking for changes made by the user\n- Fix the issue with title text not being consistent on older versions of Windows\n- Add support for x86/x32 pythonarchitecture\n\n### v1.3.7\n\n- Fix color conversion issue which returned the wrong color when the Windows accent color was set to a custom color\n- Add handling for WM_NCACTIVATE and WM_NCPAINT messages to improve title bar rendering\n- Add dynamic height adjustment to hide_titlebar method using the no_span parameter\n\n### v1.3.6\n\n- Minor Bug Fixes\n\n### v1.3.5\n\n- Add feature for automatically changing the accent color of the titlebar and border\n- Fix an issue which caused ImportError when used with a python version less than 3.9\n\n### v1.3.4\n\n- Add method for applying the current Windows accent color to the titlebar and border color\n- Add method for getting the current Windows accent color\n- Add type annotations and docstrings to functions for better clarity and autocompletion\n\n### v1.3.3\n\n- Fixed taskbar unhide/hide bug\n\n### v1.3.2\n\n- Add support for synchronizing the rainbow effect with other ui elements.\n\n### v1.3.1\n\n- Add support for UI libraries like Kivy, PySimpleGUI, PyGame, etc.\n- Improve the rainbow titlebar \u0026 border effects.\n- Improve the center_relative function \u0026 examples.\n\n### v1.3.0\n\n- Add support for setting custom border color\n- Add support for rainbow border color effect\n- Add support for resetting the titleBar color and titleText color\n- Fix an issue which caused the titleBar to appear black after the rainbow titleBar effect was stopped\n\n### v1.2.1\n\n- Minor Bug Fixes\n\n### v1.2.0\n\n- Add support for rainbow titlebar\n- Add support for styling title text\n- Add support for vertical, horizontal shake and circle motion window animations\n- Add support for centering a window on the screen\n- Add support for centering a window relative to another window\n- Add support for moving/resizing/maximizing/minimizing/restoring a window\n- Add support for setting custom titlebar color\n- Add support for setting custom titlebar text color\n\n### v1.1.3\n\n- Add flashing inverval support\n\n### v1.1.2\n\n- Add window flashing support\n- Add window opacity support\n- Add support for PyGTK\n\n### v1.1.1\n\n- Add support for WxPython, PyQt and PySide\n\n### v1.1.0\n\n- Initial Release\n\n\u003cbr\u003e\n\n![PyPI](https://img.shields.io/pypi/v/hPyT?style=flat-square)\n![Python](https://img.shields.io/badge/python-3.6+-blue)\n![Downloads](https://img.shields.io/pypi/dm/hPyT?style=flat-square)\n![Stars](https://img.shields.io/github/stars/zingzy/hPyT?style=flat-square)\n![Contributors](https://img.shields.io/github/contributors/zingzy/hPyT?style=flat-square)\n![Last Commit](https://img.shields.io/github/last-commit/zingzy/hPyT?style=flat-square)\n\n---\n\n\u003ch6 align=\"center\"\u003e\n\u003cimg src=\"https://avatars.githubusercontent.com/u/90309290?v=4\" height=30 title=\"zingzy Copyright\"\u003e\n\u003cbr\u003e\n© zingzy . 2025\n\nAll Rights Reserved\u003c/h6\u003e\n\n\u003cp align=\"center\"\u003e\n\t\u003ca href=\"https://github.com/zingzy/hPyT/blob/master/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/static/v1.svg?style=for-the-badge\u0026label=License\u0026message=MIT\u0026logoColor=d9e0ee\u0026colorA=363a4f\u0026colorB=b7bdf8\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzingzy%2Fhpyt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzingzy%2Fhpyt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzingzy%2Fhpyt/lists"}