-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwintypes.h
151 lines (116 loc) · 2.81 KB
/
wintypes.h
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
#ifndef WINTYPES_H
#define WINTYPES_H
#ifdef __cplusplus
#include <cstdint>
#else
#include <stdint.h>
#endif
#include "common/visibility.h"
#ifndef CONST
#define CONST const
#endif
#ifndef NULL
#define NULL 0
#endif
#ifndef FALSE
#define FALSE 0
#endif
#ifndef TRUE
#define TRUE 1
#endif
typedef void* PVOID;
typedef void* LPVOID;
typedef int BOOL;
typedef BOOL* LPBOOL;
typedef unsigned char BYTE;
typedef char CHAR;
typedef char16_t WCHAR;
typedef int8_t INT8;
typedef uint8_t UINT8;
typedef int16_t SHORT;
typedef uint16_t USHORT;
typedef int16_t INT16;
typedef uint16_t UINT16;
typedef int32_t INT;
typedef uint32_t UINT;
typedef int32_t INT32;
typedef uint32_t UINT32;
typedef int32_t LONG;
typedef intptr_t LONG_PTR;
typedef uint32_t ULONG;
typedef uintptr_t ULONG_PTR;
typedef ULONG_PTR SIZE_T;
typedef unsigned short WORD;
typedef uint32_t DWORD;
typedef WORD* LPWORD;
typedef DWORD* LPDWORD;
typedef uintptr_t HANDLE;
typedef HANDLE HDC;
typedef HANDLE HINSTANCE;
typedef HANDLE HMENU;
typedef HANDLE HWND;
typedef CHAR* LPSTR;
typedef WCHAR* LPWSTR;
typedef CONST CHAR* LPCCH;
typedef CONST CHAR* LPCSTR;
typedef CONST WCHAR* LPCWCH;
typedef CONST WCHAR* LPCWSTR;
#ifdef UNICODE
typedef LPWSTR LPTSTR;
#else
typedef LPSTR LPTSTR;
#endif
#ifdef UNICODE
typedef LPCWSTR LPCTSTR;
#else
typedef LPCSTR LPCTSTR;
#endif
typedef DWORD COLORREF;
typedef DWORD* LPCOLORREF;
typedef struct tagPOINT {
LONG x;
LONG y;
} POINT, *PPOINT, *LPPOINT;
typedef struct _RECT {
LONG left;
LONG top;
LONG right;
LONG bottom;
} RECT, *PRECT;
typedef struct tagMOUSEINPUT {
LONG dx;
LONG dy;
DWORD mouseData;
DWORD dwFlags;
DWORD time;
ULONG_PTR dwExtraInfo;
} MOUSEINPUT, *PMOUSEINPUT, *LPMOUSEINPUT;
typedef struct tagKEYBDINPUT {
WORD wVk;
WORD wScan;
DWORD dwFlags;
DWORD time;
ULONG_PTR dwExtraInfo;
} KEYBDINPUT, *PKEYBDINPUT, *LPKEYBDINPUT;
typedef struct tagHARDWAREINPUT {
DWORD uMsg;
WORD wParamL;
WORD wParamH;
} HARDWAREINPUT, *PHARDWAREINPUT, *LPHARDWAREINPUT;
typedef struct tagINPUT {
DWORD type;
union {
MOUSEINPUT mi;
KEYBDINPUT ki;
HARDWAREINPUT hi;
} DUMMYUNIONNAME;
} INPUT, *PINPUT, *LPINPUT;
#undef CONST
template <typename HANDLEType>
HANDLEType newHANDLE(void* ptr);
template <typename HANDLEType>
void* fromHANDLE(HANDLEType handle);
// probably unnecessary
template <typename HANDLEType>
HANDLEType toHANDLE(void* ptr);
#endif