Mercurial > cpython-lru_cache-weakref
annotate Lib/ctypes/wintypes.py @ 54294:dba767bc3155 legacy-trunk
remove mention of old ctypes version
| author | Benjamin Peterson <benjamin@python.org> |
|---|---|
| date | Sat, 23 May 2009 20:59:09 +0000 |
| parents | 67cb33880377 |
| children | b7b8970cd5a5 |
| rev | line source |
|---|---|
|
38780
381a72ab5fb8
Add pep-291 compatibility markers.
Thomas Heller <theller@ctypes.org>
parents:
36899
diff
changeset
|
1 ###################################################################### |
|
381a72ab5fb8
Add pep-291 compatibility markers.
Thomas Heller <theller@ctypes.org>
parents:
36899
diff
changeset
|
2 # This file should be kept compatible with Python 2.3, see PEP 291. # |
|
381a72ab5fb8
Add pep-291 compatibility markers.
Thomas Heller <theller@ctypes.org>
parents:
36899
diff
changeset
|
3 ###################################################################### |
|
36899
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
4 |
|
38788
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
5 # The most useful windows datatypes |
|
36899
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
6 from ctypes import * |
|
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
7 |
|
38788
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
8 BYTE = c_byte |
|
36899
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
9 WORD = c_ushort |
|
38788
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
10 DWORD = c_ulong |
|
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
11 |
|
38789
936429e10b87
Add back WCHAR, UINT, DOUBLE, _LARGE_INTEGER, _ULARGE_INTEGER.
Thomas Heller <theller@ctypes.org>
parents:
38788
diff
changeset
|
12 WCHAR = c_wchar |
|
936429e10b87
Add back WCHAR, UINT, DOUBLE, _LARGE_INTEGER, _ULARGE_INTEGER.
Thomas Heller <theller@ctypes.org>
parents:
38788
diff
changeset
|
13 UINT = c_uint |
|
48320
67cb33880377
Issue #3612: Added some missing basic types in ctypes.wintypes.
Hirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>
parents:
41913
diff
changeset
|
14 INT = c_int |
|
38789
936429e10b87
Add back WCHAR, UINT, DOUBLE, _LARGE_INTEGER, _ULARGE_INTEGER.
Thomas Heller <theller@ctypes.org>
parents:
38788
diff
changeset
|
15 |
|
936429e10b87
Add back WCHAR, UINT, DOUBLE, _LARGE_INTEGER, _ULARGE_INTEGER.
Thomas Heller <theller@ctypes.org>
parents:
38788
diff
changeset
|
16 DOUBLE = c_double |
|
48320
67cb33880377
Issue #3612: Added some missing basic types in ctypes.wintypes.
Hirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>
parents:
41913
diff
changeset
|
17 FLOAT = c_float |
|
38789
936429e10b87
Add back WCHAR, UINT, DOUBLE, _LARGE_INTEGER, _ULARGE_INTEGER.
Thomas Heller <theller@ctypes.org>
parents:
38788
diff
changeset
|
18 |
|
38788
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
19 BOOLEAN = BYTE |
|
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
20 BOOL = c_long |
|
38789
936429e10b87
Add back WCHAR, UINT, DOUBLE, _LARGE_INTEGER, _ULARGE_INTEGER.
Thomas Heller <theller@ctypes.org>
parents:
38788
diff
changeset
|
21 |
|
936429e10b87
Add back WCHAR, UINT, DOUBLE, _LARGE_INTEGER, _ULARGE_INTEGER.
Thomas Heller <theller@ctypes.org>
parents:
38788
diff
changeset
|
22 from ctypes import _SimpleCData |
|
936429e10b87
Add back WCHAR, UINT, DOUBLE, _LARGE_INTEGER, _ULARGE_INTEGER.
Thomas Heller <theller@ctypes.org>
parents:
38788
diff
changeset
|
23 class VARIANT_BOOL(_SimpleCData): |
|
936429e10b87
Add back WCHAR, UINT, DOUBLE, _LARGE_INTEGER, _ULARGE_INTEGER.
Thomas Heller <theller@ctypes.org>
parents:
38788
diff
changeset
|
24 _type_ = "v" |
|
936429e10b87
Add back WCHAR, UINT, DOUBLE, _LARGE_INTEGER, _ULARGE_INTEGER.
Thomas Heller <theller@ctypes.org>
parents:
38788
diff
changeset
|
25 def __repr__(self): |
|
936429e10b87
Add back WCHAR, UINT, DOUBLE, _LARGE_INTEGER, _ULARGE_INTEGER.
Thomas Heller <theller@ctypes.org>
parents:
38788
diff
changeset
|
26 return "%s(%r)" % (self.__class__.__name__, self.value) |
|
36899
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
27 |
|
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
28 ULONG = c_ulong |
|
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
29 LONG = c_long |
|
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
30 |
|
48320
67cb33880377
Issue #3612: Added some missing basic types in ctypes.wintypes.
Hirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>
parents:
41913
diff
changeset
|
31 USHORT = c_ushort |
|
67cb33880377
Issue #3612: Added some missing basic types in ctypes.wintypes.
Hirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>
parents:
41913
diff
changeset
|
32 SHORT = c_short |
|
67cb33880377
Issue #3612: Added some missing basic types in ctypes.wintypes.
Hirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>
parents:
41913
diff
changeset
|
33 |
|
38788
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
34 # in the windows header files, these are structures. |
|
38789
936429e10b87
Add back WCHAR, UINT, DOUBLE, _LARGE_INTEGER, _ULARGE_INTEGER.
Thomas Heller <theller@ctypes.org>
parents:
38788
diff
changeset
|
35 _LARGE_INTEGER = LARGE_INTEGER = c_longlong |
|
936429e10b87
Add back WCHAR, UINT, DOUBLE, _LARGE_INTEGER, _ULARGE_INTEGER.
Thomas Heller <theller@ctypes.org>
parents:
38788
diff
changeset
|
36 _ULARGE_INTEGER = ULARGE_INTEGER = c_ulonglong |
|
36899
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
37 |
|
38788
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
38 LPCOLESTR = LPOLESTR = OLESTR = c_wchar_p |
|
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
39 LPCWSTR = LPWSTR = c_wchar_p |
|
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
40 LPCSTR = LPSTR = c_char_p |
|
48320
67cb33880377
Issue #3612: Added some missing basic types in ctypes.wintypes.
Hirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>
parents:
41913
diff
changeset
|
41 LPCVOID = LPVOID = c_void_p |
|
36899
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
42 |
|
40605
6899b740e8ea
Correct the comments: the code is right.
Thomas Heller <theller@ctypes.org>
parents:
40604
diff
changeset
|
43 # WPARAM is defined as UINT_PTR (unsigned type) |
|
6899b740e8ea
Correct the comments: the code is right.
Thomas Heller <theller@ctypes.org>
parents:
40604
diff
changeset
|
44 # LPARAM is defined as LONG_PTR (signed type) |
|
40604
7d8868cfba7c
Fixes for 64-bit Windows: In ctypes.wintypes, correct the definitions
Thomas Heller <theller@ctypes.org>
parents:
38830
diff
changeset
|
45 if sizeof(c_long) == sizeof(c_void_p): |
|
7d8868cfba7c
Fixes for 64-bit Windows: In ctypes.wintypes, correct the definitions
Thomas Heller <theller@ctypes.org>
parents:
38830
diff
changeset
|
46 WPARAM = c_ulong |
|
7d8868cfba7c
Fixes for 64-bit Windows: In ctypes.wintypes, correct the definitions
Thomas Heller <theller@ctypes.org>
parents:
38830
diff
changeset
|
47 LPARAM = c_long |
|
7d8868cfba7c
Fixes for 64-bit Windows: In ctypes.wintypes, correct the definitions
Thomas Heller <theller@ctypes.org>
parents:
38830
diff
changeset
|
48 elif sizeof(c_longlong) == sizeof(c_void_p): |
|
7d8868cfba7c
Fixes for 64-bit Windows: In ctypes.wintypes, correct the definitions
Thomas Heller <theller@ctypes.org>
parents:
38830
diff
changeset
|
49 WPARAM = c_ulonglong |
|
7d8868cfba7c
Fixes for 64-bit Windows: In ctypes.wintypes, correct the definitions
Thomas Heller <theller@ctypes.org>
parents:
38830
diff
changeset
|
50 LPARAM = c_longlong |
|
36899
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
51 |
|
38788
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
52 ATOM = WORD |
|
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
53 LANGID = WORD |
|
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
54 |
|
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
55 COLORREF = DWORD |
|
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
56 LGRPID = DWORD |
|
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
57 LCTYPE = DWORD |
|
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
58 |
|
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
59 LCID = DWORD |
|
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
60 |
|
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
61 ################################################################ |
|
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
62 # HANDLE types |
|
40604
7d8868cfba7c
Fixes for 64-bit Windows: In ctypes.wintypes, correct the definitions
Thomas Heller <theller@ctypes.org>
parents:
38830
diff
changeset
|
63 HANDLE = c_void_p # in the header files: void * |
|
36899
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
64 |
|
38788
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
65 HACCEL = HANDLE |
|
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
66 HBITMAP = HANDLE |
|
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
67 HBRUSH = HANDLE |
|
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
68 HCOLORSPACE = HANDLE |
|
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
69 HDC = HANDLE |
|
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
70 HDESK = HANDLE |
|
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
71 HDWP = HANDLE |
|
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
72 HENHMETAFILE = HANDLE |
|
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
73 HFONT = HANDLE |
|
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
74 HGDIOBJ = HANDLE |
|
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
75 HGLOBAL = HANDLE |
|
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
76 HHOOK = HANDLE |
|
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
77 HICON = HANDLE |
|
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
78 HINSTANCE = HANDLE |
|
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
79 HKEY = HANDLE |
|
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
80 HKL = HANDLE |
|
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
81 HLOCAL = HANDLE |
|
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
82 HMENU = HANDLE |
|
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
83 HMETAFILE = HANDLE |
|
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
84 HMODULE = HANDLE |
|
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
85 HMONITOR = HANDLE |
|
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
86 HPALETTE = HANDLE |
|
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
87 HPEN = HANDLE |
|
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
88 HRGN = HANDLE |
|
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
89 HRSRC = HANDLE |
|
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
90 HSTR = HANDLE |
|
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
91 HTASK = HANDLE |
|
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
92 HWINSTA = HANDLE |
|
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
93 HWND = HANDLE |
|
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
94 SC_HANDLE = HANDLE |
|
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
95 SERVICE_STATUS_HANDLE = HANDLE |
|
36899
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
96 |
|
38788
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
97 ################################################################ |
|
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
98 # Some important structure definitions |
|
36899
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
99 |
|
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
100 class RECT(Structure): |
|
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
101 _fields_ = [("left", c_long), |
|
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
102 ("top", c_long), |
|
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
103 ("right", c_long), |
|
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
104 ("bottom", c_long)] |
|
38788
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
105 tagRECT = _RECTL = RECTL = RECT |
|
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
106 |
|
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
107 class _SMALL_RECT(Structure): |
|
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
108 _fields_ = [('Left', c_short), |
|
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
109 ('Top', c_short), |
|
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
110 ('Right', c_short), |
|
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
111 ('Bottom', c_short)] |
|
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
112 SMALL_RECT = _SMALL_RECT |
|
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
113 |
|
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
114 class _COORD(Structure): |
|
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
115 _fields_ = [('X', c_short), |
|
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
116 ('Y', c_short)] |
|
36899
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
117 |
|
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
118 class POINT(Structure): |
|
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
119 _fields_ = [("x", c_long), |
|
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
120 ("y", c_long)] |
|
38788
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
121 tagPOINT = _POINTL = POINTL = POINT |
|
36899
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
122 |
|
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
123 class SIZE(Structure): |
|
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
124 _fields_ = [("cx", c_long), |
|
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
125 ("cy", c_long)] |
|
38788
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
126 tagSIZE = SIZEL = SIZE |
|
36899
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
127 |
|
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
128 def RGB(red, green, blue): |
|
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
129 return red + (green << 8) + (blue << 16) |
|
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
130 |
|
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
131 class FILETIME(Structure): |
|
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
132 _fields_ = [("dwLowDateTime", DWORD), |
|
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
133 ("dwHighDateTime", DWORD)] |
|
38788
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
134 _FILETIME = FILETIME |
|
36899
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
135 |
|
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
136 class MSG(Structure): |
|
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
137 _fields_ = [("hWnd", HWND), |
|
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
138 ("message", c_uint), |
|
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
139 ("wParam", WPARAM), |
|
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
140 ("lParam", LPARAM), |
|
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
141 ("time", DWORD), |
|
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
142 ("pt", POINT)] |
|
38788
914da1036eed
Add some windows datatypes that were missing from this file, and add
Thomas Heller <theller@ctypes.org>
parents:
38780
diff
changeset
|
143 tagMSG = MSG |
|
36899
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
144 MAX_PATH = 260 |
|
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
145 |
|
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
146 class WIN32_FIND_DATAA(Structure): |
|
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
147 _fields_ = [("dwFileAttributes", DWORD), |
|
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
148 ("ftCreationTime", FILETIME), |
|
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
149 ("ftLastAccessTime", FILETIME), |
|
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
150 ("ftLastWriteTime", FILETIME), |
|
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
151 ("nFileSizeHigh", DWORD), |
|
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
152 ("nFileSizeLow", DWORD), |
|
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
153 ("dwReserved0", DWORD), |
|
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
154 ("dwReserved1", DWORD), |
|
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
155 ("cFileName", c_char * MAX_PATH), |
|
41913
aaf3b6d82b63
Correct the name of a field in the WIN32_FIND_DATAA and WIN32_FIND_DATAW structures.
Thomas Heller <theller@ctypes.org>
parents:
40605
diff
changeset
|
156 ("cAlternateFileName", c_char * 14)] |
|
36899
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
157 |
|
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
158 class WIN32_FIND_DATAW(Structure): |
|
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
159 _fields_ = [("dwFileAttributes", DWORD), |
|
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
160 ("ftCreationTime", FILETIME), |
|
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
161 ("ftLastAccessTime", FILETIME), |
|
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
162 ("ftLastWriteTime", FILETIME), |
|
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
163 ("nFileSizeHigh", DWORD), |
|
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
164 ("nFileSizeLow", DWORD), |
|
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
165 ("dwReserved0", DWORD), |
|
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
166 ("dwReserved1", DWORD), |
|
0023c0cf8feb
Copy ctypes-0.9.9.4 Python modules from external into the trunk.
Thomas Heller <theller@ctypes.org>
parents:
diff
changeset
|
167 ("cFileName", c_wchar * MAX_PATH), |
|
41913
aaf3b6d82b63
Correct the name of a field in the WIN32_FIND_DATAA and WIN32_FIND_DATAW structures.
Thomas Heller <theller@ctypes.org>
parents:
40605
diff
changeset
|
168 ("cAlternateFileName", c_wchar * 14)] |
|
38830
0cf2eb3cc50a
Add an __all__ list, since this module does 'from ctypes import *'.
Thomas Heller <theller@ctypes.org>
parents:
38789
diff
changeset
|
169 |
|
48320
67cb33880377
Issue #3612: Added some missing basic types in ctypes.wintypes.
Hirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>
parents:
41913
diff
changeset
|
170 __all__ = ['ATOM', 'BOOL', 'BOOLEAN', 'BYTE', 'COLORREF', 'DOUBLE', 'DWORD', |
|
67cb33880377
Issue #3612: Added some missing basic types in ctypes.wintypes.
Hirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>
parents:
41913
diff
changeset
|
171 'FILETIME', 'FLOAT', 'HACCEL', 'HANDLE', 'HBITMAP', 'HBRUSH', |
|
38830
0cf2eb3cc50a
Add an __all__ list, since this module does 'from ctypes import *'.
Thomas Heller <theller@ctypes.org>
parents:
38789
diff
changeset
|
172 'HCOLORSPACE', 'HDC', 'HDESK', 'HDWP', 'HENHMETAFILE', 'HFONT', |
|
0cf2eb3cc50a
Add an __all__ list, since this module does 'from ctypes import *'.
Thomas Heller <theller@ctypes.org>
parents:
38789
diff
changeset
|
173 'HGDIOBJ', 'HGLOBAL', 'HHOOK', 'HICON', 'HINSTANCE', 'HKEY', |
|
0cf2eb3cc50a
Add an __all__ list, since this module does 'from ctypes import *'.
Thomas Heller <theller@ctypes.org>
parents:
38789
diff
changeset
|
174 'HKL', 'HLOCAL', 'HMENU', 'HMETAFILE', 'HMODULE', 'HMONITOR', |
|
0cf2eb3cc50a
Add an __all__ list, since this module does 'from ctypes import *'.
Thomas Heller <theller@ctypes.org>
parents:
38789
diff
changeset
|
175 'HPALETTE', 'HPEN', 'HRGN', 'HRSRC', 'HSTR', 'HTASK', 'HWINSTA', |
|
48320
67cb33880377
Issue #3612: Added some missing basic types in ctypes.wintypes.
Hirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>
parents:
41913
diff
changeset
|
176 'HWND', 'INT', 'LANGID', 'LARGE_INTEGER', 'LCID', 'LCTYPE', |
|
67cb33880377
Issue #3612: Added some missing basic types in ctypes.wintypes.
Hirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>
parents:
41913
diff
changeset
|
177 'LGRPID', 'LONG', 'LPARAM', 'LPCOLESTR', 'LPCSTR', 'LPCVOID', |
|
67cb33880377
Issue #3612: Added some missing basic types in ctypes.wintypes.
Hirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>
parents:
41913
diff
changeset
|
178 'LPCWSTR', 'LPOLESTR', 'LPSTR', 'LPVOID', 'LPWSTR', 'MAX_PATH', |
|
67cb33880377
Issue #3612: Added some missing basic types in ctypes.wintypes.
Hirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>
parents:
41913
diff
changeset
|
179 'MSG', 'OLESTR', 'POINT', 'POINTL', 'RECT', 'RECTL', 'RGB', |
|
67cb33880377
Issue #3612: Added some missing basic types in ctypes.wintypes.
Hirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>
parents:
41913
diff
changeset
|
180 'SC_HANDLE', 'SERVICE_STATUS_HANDLE', 'SHORT', 'SIZE', 'SIZEL', |
|
67cb33880377
Issue #3612: Added some missing basic types in ctypes.wintypes.
Hirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>
parents:
41913
diff
changeset
|
181 'SMALL_RECT', 'UINT', 'ULARGE_INTEGER', 'ULONG', 'USHORT', |
|
67cb33880377
Issue #3612: Added some missing basic types in ctypes.wintypes.
Hirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>
parents:
41913
diff
changeset
|
182 'VARIANT_BOOL', 'WCHAR', 'WIN32_FIND_DATAA', 'WIN32_FIND_DATAW', |
|
67cb33880377
Issue #3612: Added some missing basic types in ctypes.wintypes.
Hirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>
parents:
41913
diff
changeset
|
183 'WORD', 'WPARAM', '_COORD', '_FILETIME', '_LARGE_INTEGER', |
|
67cb33880377
Issue #3612: Added some missing basic types in ctypes.wintypes.
Hirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>
parents:
41913
diff
changeset
|
184 '_POINTL', '_RECTL', '_SMALL_RECT', '_ULARGE_INTEGER', 'tagMSG', |
|
67cb33880377
Issue #3612: Added some missing basic types in ctypes.wintypes.
Hirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>
parents:
41913
diff
changeset
|
185 'tagPOINT', 'tagRECT', 'tagSIZE'] |
