https://github.com/littlewhitecloud/win32mica
Apply mica effect for win32 applications
https://github.com/littlewhitecloud/win32mica
application blur c cplusplus dll header lib material mica mica-material msvc python win32 windows windows11
Last synced: 8 months ago
JSON representation
Apply mica effect for win32 applications
- Host: GitHub
- URL: https://github.com/littlewhitecloud/win32mica
- Owner: littlewhitecloud
- License: mit
- Archived: true
- Created: 2023-07-26T05:21:53.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-08-31T10:25:14.000Z (about 2 years ago)
- Last Synced: 2024-10-14T21:22:18.226Z (12 months ago)
- Topics: application, blur, c, cplusplus, dll, header, lib, material, mica, mica-material, msvc, python, win32, windows, windows11
- Language: C++
- Homepage:
- Size: 284 KB
- Stars: 8
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# win32mica
Apply mica effect for win32 applications### Python
#### Usage
```python
# 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 = Trueimport ctypes
ApplyMica(ctypes.windll.user32.FindWindowW(ctypes.c_char_p(None), "{Target Window Name}"), MICATHEME, MICAMODE);
```### Example
```python
from tkinter import Tk
from win32mica import ApplyMica, MICATHEME, MICAMODE
from ctypes import windll, c_char_pexample = 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 windowexample["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 altexample.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
```c++
#include
#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);
```### Light mode
#### Mica

#### Mica Alt

### Dark mode
#### Mica

#### Mica Alt
