-
-
Notifications
You must be signed in to change notification settings - Fork 799
Expand file tree
/
Copy pathcomctl32classes.py
More file actions
185 lines (158 loc) · 4.32 KB
/
comctl32classes.py
File metadata and controls
185 lines (158 loc) · 4.32 KB
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
from ctypes import (
WINFUNCTYPE,
Structure as c_Structure,
)
from ctypes.wintypes import (
COLORREF,
DWORD,
HDC,
HWND,
INT,
LPARAM,
LPWSTR,
POINT,
RECT,
SIZE,
UINT,
WPARAM,
)
from .win32 import DWORD_PTR, INT_PTR, LRESULT, PUINT, UINT_PTR
# learn.microsoft.com/en-us/windows/win32/api/commctrl/ns-commctrl-initcommoncontrolsex
class INITCOMMONCONTROLSEX(c_Structure):
_fields_ = [
("dwSize", DWORD),
("dwICC", DWORD),
]
# https://learn.microsoft.com/en-us/windows/win32/api/commctrl/ns-commctrl-lvitemw
class LVITEMW(c_Structure):
_fields_ = [
("uiMask", UINT),
("iItem", INT),
("iSubItem", INT),
("state", UINT),
("stateMask", UINT),
("pszText", LPWSTR),
("cchTextMax", INT),
("iImage", INT),
("lParam", LPARAM),
("iIndent", INT),
("iGroupId", INT),
("cColumns", UINT),
("puColumns", PUINT),
("piColFmt", INT_PTR),
("iGroup", INT),
]
# learn.microsoft.com/en-us/windows/win32/api/commctrl/ns-commctrl-lvcolumnw
class LVCOLUMNW(c_Structure):
_fields_ = [
("mask", UINT),
("fmt", INT),
("cx", INT),
("pszText", LPWSTR),
("cchTextMax", INT),
("iSubItem", INT),
("cchTextMax", INT),
("iImage", INT),
("iOrder", INT),
("cxMin", INT),
("cxDefault", INT),
("cxIdeal", INT),
]
# learn.microsoft.com/en-us/windows/win32/api/commctrl/ns-commctrl-lvhittestinfo
class LVHITTESTINFO(c_Structure):
_fields_ = [
("pt", POINT),
("flags", UINT),
("iItem", INT),
("iSubItem", INT),
("iGroup", INT),
]
# learn.microsoft.com/en-us/windows/win32/api/commctrl/ns-commctrl-lvtileviewinfo
class LVTILEVIEWINFO(c_Structure):
_fields_ = [
("cbSize", UINT),
("dwMask", DWORD),
("dwFlags", DWORD),
("sizeTile", SIZE),
("cLines", INT),
("rcLabelMargin", RECT),
]
# Import .user32classes here to avoid circular reference.
from .user32classes import NMHDR # noqa
# https://learn.microsoft.com/en-us/windows/win32/api/commctrl/ns-commctrl-nmcustomdraw
class NMCUSTOMDRAW(c_Structure):
_fields_ = [
("hdr", NMHDR),
("dwDrawStage", DWORD),
("hdc", HDC),
("rc", RECT),
("dwItemSpec", DWORD_PTR),
("uItemState", UINT),
("lItemlParam", LPARAM),
]
# learn.microsoft.com/en-us/windows/win32/api/commctrl/ns-commctrl-nmitemactivate
class NMITEMACTIVATE(c_Structure):
_fields_ = [
("hdr", NMHDR),
("iItem", INT),
("iSubItem", INT),
("uNewState", UINT),
("uOldState", UINT),
("uChanged", UINT),
("ptAction", POINT),
("lParam", LPARAM),
("uKeyFlags", UINT),
]
# https://learn.microsoft.com/en-us/windows/win32/api/commctrl/ns-commctrl-nmlistview
class NMLISTVIEW(c_Structure):
_fields_ = [
("hdr", NMHDR),
("iItem", INT),
("iSubItem", INT),
("uNewState", UINT),
("uOldState", UINT),
("uChanged", UINT),
("ptAction", POINT),
("lParam", LPARAM),
]
# https://learn.microsoft.com/en-us/windows/win32/api/commctrl/ns-commctrl-nmlvcachehint
class NMLVCACHEHINT(c_Structure):
_fields_ = [
("hdr", NMHDR),
("iFrom", INT),
("iTo", INT),
]
# https://learn.microsoft.com/en-us/windows/win32/api/commctrl/ns-commctrl-nmlvcustomdraw
class NMLVCUSTOMDRAW(c_Structure):
_fields_ = [
("nmcd", NMCUSTOMDRAW),
("clrText", COLORREF),
("clrTextBk", COLORREF),
("iSubItem", INT),
("dwItemType", DWORD),
("clrFace", COLORREF),
("iIconEffect", INT),
("iIconPhase", INT),
("iPartId", INT),
("iStateId", INT),
("rcText", RECT),
("uAlign", UINT),
]
# https://learn.microsoft.com/en-us/windows/win32/api/commctrl/ns-commctrl-nmlvdispinfow
class NMLVDISPINFOW(c_Structure):
_fields_ = [
("hdr", NMHDR),
("item", LVITEMW),
]
# https://learn.microsoft.com/en-us/windows/win32/api/commctrl/nc-commctrl-subclassproc
SUBCLASSPROC = WINFUNCTYPE(
# Return type:
LRESULT,
# Argument types:
HWND,
UINT,
WPARAM,
LPARAM,
UINT_PTR,
DWORD_PTR,
)