This repository has been archived by the owner on Sep 10, 2023. It is now read-only.
Releases: littlewhitecloud/win32mica
Releases · littlewhitecloud/win32mica
Release v1.0.1 - Mica Alt
Light mode
Mica
Mica Alt
Dark mode
Mica
Mica Alt
win32mica
Apply mica effect for win32 applications
Python
Usage
# from win32mica import ApplyMica
# ApplyMica(hwnd: int, theme: bol): function
# hwnd: your window hwnd
# theme: true -> dark | false -> light
#
# from win32mica import MICATHEME
# MICATHEME: class
# LIGHT: bool = False
# DARK: bool = True
# MICAMODE: class
# DEFAULT: bool = False
# ALT: bool = True
import ctypes
ApplyMica(ctypes.windll.user32.FindWindowW(ctypes.c_char_p(None), "{Target Window Name}"), MICATHEME, MICAMODE);
Example
from tkinter import Tk
from win32mica import ApplyMica, MICATHEME, MICAMODE
from ctypes import windll, c_char_p
example = Tk() # Create a Tk window
example.geometry("1165x605") # Set the size of the window
example.title("Mica Example") # Set the title of the window
# Without this line, the FindWindowW can't find the hwnd correctly
example.iconbitmap("") # Set the icon of the window
example["background"] = "black" # Add this line if you want the full mica effect(Also light mode)
ApplyMica(windll.user32.FindWindowW(c_char_p(None), "Mica Example"), MICATHEME.DARK, MICAMODE.ALT)
# Use False or MICATHEME.LIGHT to apply light mica effect
# USe False or MICAMODE.DEFAULT to apply mica effect, not mica alt
example.mainloop() # Window mainloop
C++
If you want to run the example, please copy
win32mica.h
win32mica.lib
win32mica.dll
here and compile the file
Usage
#include <Windows.h>
#include "win32mica.h"
#pragma comment(lib, "win32mica.lib")
#pragma comment(lib, "user32.lib")
// true to apply dark mode
// false to apply light mode
// Works for Windows 11 22523+
ApplyDocumentMica(FindWindowW(NULL, L"{Target Window Name}"), MICATHEME, MICAMODE);
// Works for Windows 11 22523-
// ApplyUnDocumentMica(FindWindowW(NULL, L"{Target Window Name}"), MICATHEME, MICAMODE);
Full Changelog: v1.0.0...v1.0.1
Release v1.0.0 - The first version
win32mica
Apply mica effect for win32 applications
Python
# from win32mica import ApplyMica
# ApplyMica(hwnd: int, theme: bool)
# hwnd: your window hwnd
# theme: true -> dark | false -> light
#
# from win32mica import MICATHEME
# MICATHEME: class
# LIGHT: bool = 0
# DARK: bool = 1
# A small example
from tkinter import Tk
from win32mica import ApplyMica, MICATHEME
from ctypes import windll, c_char_p
example = Tk() # Create a Tk window
example.geometry("1165x605") # Set the size of the window
example.title("Mica Example") # Set the title of the window
# Without this line, the FindWindowW can't find the hwnd correctly
example.iconbitmap("") # Set the icon of the window
example["background"] = "black" # Add this line if you want the full mica effect
ApplyMica(windll.user32.FindWindowW(c_char_p(None), "Mica Example"), MICATHEME.DARK) # Use False to apply light mica effect
example.mainloop() # Window mainloop
C++
If you want to run the example, please copy
plugin.h
plugin.lib
plugin.dll
here and compile the file
#include <Windows.h>
#include "plugin.h"
#pragma comment(lib, "plugin.lib")
#pragma comment(lib, "user32.lib")
// Works for Windows 11 22523+
ApplyDocumentMica(FindWindowW(NULL, L"{Target Window Name}"), ...);
// Works for Windows 11 22523-
// ApplyUnDocumentMica(FindWindowW(NULL, L"{Target Window Name}"), ...);
View
Welcome to use the repo and report bugs!
Full Changelog: https://github.com/littlewhitecloud/win32mica/commits/v1.0.0