-
-
Notifications
You must be signed in to change notification settings - Fork 80
/
rounder.py
88 lines (72 loc) · 2.25 KB
/
rounder.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# WIN32BLUR
import ctypes as ct
#from enum import IntEnum, Enum
#user32 = ctypes.windll.user32
#c_ulong = ctypes.c_ulong
"""
class DWM_WINDOW_CORNER_PREFERENCE(ctypes.c_int):
DWMWCP_DEFAULT = 0
DWMWCP_DONOTROUND = 1
DWMWCP_ROUND = 2
DWMWCP_ROUNDSMALL = 3
class ACCENTPOLICY(ctypes.Structure):
_fields_ = [
("AccentState", ACCENTSTATE),
("AccentFlags", ctypes.c_uint),
("GradientColor", ctypes.c_uint),
("AnimationId", ctypes.c_uint)
]
class WINDOWCOMPOSITIONATTRIB(ctypes.c_int): # look into this type
WCA_UNDEFINED = 0
WCA_NCRENDERING_ENABLED = 1
WCA_NCRENDERING_POLICY = 2
WCA_TRANSITIONS_FORCEDISABLED = 3
WCA_ALLOW_NCPAINT = 4
WCA_CAPTION_BUTTON_BOUNDS = 5
WCA_NONCLIENT_RTL_LAYOUT = 6
WCA_FORCE_ICONIC_REPRESENTATION = 7
WCA_EXTENDED_FRAME_BOUNDS = 8
WCA_HAS_ICONIC_BITMAP = 9
WCA_THEME_ATTRIBUTES = 10
WCA_NCRENDERING_EXILED = 11
WCA_NCADORNMENTINFO = 12
WCA_EXCLUDED_FROM_LIVEPREVIEW = 13
WCA_VIDEO_OVERLAY_ACTIVE = 14
WCA_FORCE_ACTIVEWINDOW_APPEARANCE = 15
WCA_DISALLOW_PEEK = 16
WCA_CLOAK = 17
WCA_CLOAKED = 18
WCA_ACCENT_POLICY = 19
WCA_FREEZE_REPRESENTATION = 20
WCA_EVER_UNCLOAKED = 21
WCA_VISUAL_OWNER = 22
WCA_HOLOGRAPHIC = 23
WCA_EXCLUDED_FROM_DDA = 24
WCA_PASSIVEUPDATEMODE = 25
WCA_USEDARKMODECOLORS = 26
WCA_LAST = 27
DWMWA_WINDOW_CORNER_PREFERENCE = 33
class WINDOWCOMPOSITIONATTRIBDATA(ctypes.Structure):
_fields_ = [
("Attribute", WINDOWCOMPOSITIONATTRIB),
("Data", ctypes.POINTER(ctypes.c_int)),
("SizeOfData", ctypes.c_size_t)
]
accent = ACCENTPOLICY()
accent.AccentState = ACCENTSTATE.ACCENT_ENABLE_ACRYLICBLURBEHIND
accent.GradientColor = ctypes.c_uint(0xCC000000)
#accent.AccentFlags = 2
accentStructSize = ctypes.sizeof(accent)
data = WINDOWCOMPOSITIONATTRIBDATA()
data.Attribute = WINDOWCOMPOSITIONATTRIB.WCA_ACCENT_POLICY
data.SizeOfData = accentStructSize
data.Data = ctypes.cast(ctypes.pointer(accent), ctypes.POINTER(ctypes.c_int))
"""
def round(HWND):
swa = ct.windll.dwmapi.DwmSetWindowAttribute
mode = ct.c_int(2)
s = swa(HWND, 33, ct.byref(mode), ct.sizeof(mode))
if s == 0:
return True
else:
return False