1 /** 2 * This file has no copyright assigned and is placed in the Public Domain. 3 * This file is part of the mingw-w64 runtime package. 4 * No warranty is given; refer to the file DISCLAIMER.PD within this package. 5 */ 6 #ifndef _WINDEF_ 7 #define _WINDEF_ 8 9 #include <_mingw.h> 10 11 #if !defined (STRICT) && !defined (NO_STRICT) 12 #define STRICT 1 13 #endif 14 15 #ifdef __cplusplus 16 extern "C" { 17 #endif 18 19 #ifndef WINVER 20 #define WINVER 0x0502 21 #endif 22 23 #ifndef BASETYPES 24 #define BASETYPES 25 typedef unsigned __LONG32 ULONG; 26 typedef ULONG *PULONG; 27 typedef unsigned short USHORT; 28 typedef USHORT *PUSHORT; 29 typedef unsigned char UCHAR; 30 typedef UCHAR *PUCHAR; 31 typedef char *PSZ; 32 #endif 33 34 #define MAX_PATH 260 35 36 #ifndef NULL 37 #ifdef __cplusplus 38 #ifndef _WIN64 39 #define NULL 0 40 #else 41 #define NULL 0LL 42 #endif /* W64 */ 43 #else 44 #define NULL ((void *)0) 45 #endif 46 #endif 47 48 #ifndef FALSE 49 #define FALSE 0 50 #endif 51 52 #ifndef TRUE 53 #define TRUE 1 54 #endif 55 56 #ifndef _NO_W32_PSEUDO_MODIFIERS 57 #ifndef IN 58 #define IN 59 #endif 60 #ifndef OUT 61 #define OUT 62 #endif 63 #ifndef OPTIONAL 64 #define OPTIONAL 65 #endif 66 #endif 67 68 #undef far 69 #undef near 70 #undef pascal 71 72 #define far 73 #define near 74 #define pascal __stdcall 75 76 #define cdecl 77 #ifndef CDECL 78 #define CDECL 79 #endif 80 #ifndef CALLBACK 81 #define CALLBACK __stdcall 82 #endif 83 #ifndef WINAPI 84 #define WINAPI __stdcall 85 #endif 86 #define WINAPIV __cdecl 87 #define APIENTRY WINAPI 88 #define APIPRIVATE WINAPI 89 #define PASCAL WINAPI 90 #define WINAPI_INLINE WINAPI 91 92 #undef FAR 93 #undef NEAR 94 #define FAR 95 #define NEAR 96 97 #ifndef CONST 98 #define CONST const 99 #endif 100 101 #ifndef _DEF_WINBOOL_ 102 #define _DEF_WINBOOL_ 103 typedef int WINBOOL; 104 #pragma push_macro("BOOL") 105 #undef BOOL 106 #if !defined(__OBJC__) && !defined(__OBJC_BOOL) && !defined(__objc_INCLUDE_GNU) && !defined(_NO_BOOL_TYPEDEF) 107 typedef int BOOL; 108 #endif 109 #define BOOL WINBOOL 110 typedef BOOL *PBOOL; 111 typedef BOOL *LPBOOL; 112 #pragma pop_macro("BOOL") 113 #endif /* _DEF_WINBOOL_ */ 114 115 typedef unsigned char BYTE; 116 typedef unsigned short WORD; 117 typedef unsigned __LONG32 DWORD; 118 typedef float FLOAT; 119 typedef FLOAT *PFLOAT; 120 typedef BYTE *PBYTE; 121 typedef BYTE *LPBYTE; 122 typedef int *PINT; 123 typedef int *LPINT; 124 typedef WORD *PWORD; 125 typedef WORD *LPWORD; 126 typedef __LONG32 *LPLONG; 127 typedef DWORD *PDWORD; 128 typedef DWORD *LPDWORD; 129 typedef void *LPVOID; 130 #ifndef _LPCVOID_DEFINED 131 #define _LPCVOID_DEFINED 132 typedef CONST void *LPCVOID; 133 #endif 134 typedef int INT; 135 typedef unsigned int UINT; 136 typedef unsigned int *PUINT; 137 138 #ifndef NT_INCLUDED 139 #include <winnt.h> 140 #endif 141 142 #include <specstrings.h> 143 144 typedef UINT_PTR WPARAM; 145 typedef LONG_PTR LPARAM; 146 typedef LONG_PTR LRESULT; 147 148 #ifndef __cplusplus 149 #ifndef NOMINMAX 150 #ifndef max 151 #define max(a,b) (((a) > (b)) ? (a) : (b)) 152 #endif 153 154 #ifndef min 155 #define min(a,b) (((a) < (b)) ? (a) : (b)) 156 #endif 157 #endif 158 #endif 159 160 #define MAKEWORD(a,b) ((WORD)(((BYTE)((DWORD_PTR)(a) & 0xff)) | ((WORD)((BYTE)((DWORD_PTR)(b) & 0xff))) << 8)) 161 #define MAKELONG(a,b) ((LONG)(((WORD)((DWORD_PTR)(a) & 0xffff)) | ((DWORD)((WORD)((DWORD_PTR)(b) & 0xffff))) << 16)) 162 #define LOWORD(l) ((WORD)((DWORD_PTR)(l) & 0xffff)) 163 #define HIWORD(l) ((WORD)((DWORD_PTR)(l) >> 16)) 164 #define LOBYTE(w) ((BYTE)((DWORD_PTR)(w) & 0xff)) 165 #define HIBYTE(w) ((BYTE)((DWORD_PTR)(w) >> 8)) 166 167 #ifndef WIN_INTERNAL 168 DECLARE_HANDLE (HWND); 169 DECLARE_HANDLE (HHOOK); 170 #ifdef WINABLE 171 DECLARE_HANDLE (HEVENT); 172 #endif 173 #endif 174 175 typedef WORD ATOM; 176 177 typedef HANDLE *SPHANDLE; 178 typedef HANDLE *LPHANDLE; 179 typedef HANDLE HGLOBAL; 180 typedef HANDLE HLOCAL; 181 typedef HANDLE GLOBALHANDLE; 182 typedef HANDLE LOCALHANDLE; 183 #ifdef _WIN64 184 typedef INT_PTR (WINAPI *FARPROC)(); 185 typedef INT_PTR (WINAPI *NEARPROC)(); 186 typedef INT_PTR (WINAPI *PROC)(); 187 #else 188 typedef int (WINAPI *FARPROC)(); 189 typedef int (WINAPI *NEARPROC)(); 190 typedef int (WINAPI *PROC)(); 191 #endif 192 193 typedef void *HGDIOBJ; 194 195 DECLARE_HANDLE(HKEY); 196 typedef HKEY *PHKEY; 197 198 DECLARE_HANDLE(HACCEL); 199 DECLARE_HANDLE(HBITMAP); 200 DECLARE_HANDLE(HBRUSH); 201 DECLARE_HANDLE(HCOLORSPACE); 202 DECLARE_HANDLE(HDC); 203 DECLARE_HANDLE(HGLRC); 204 DECLARE_HANDLE(HDESK); 205 DECLARE_HANDLE(HENHMETAFILE); 206 DECLARE_HANDLE(HFONT); 207 DECLARE_HANDLE(HICON); 208 DECLARE_HANDLE(HMENU); 209 DECLARE_HANDLE(HMETAFILE); 210 DECLARE_HANDLE(HINSTANCE); 211 typedef HINSTANCE HMODULE; 212 DECLARE_HANDLE(HPALETTE); 213 DECLARE_HANDLE(HPEN); 214 DECLARE_HANDLE(HRGN); 215 DECLARE_HANDLE(HRSRC); 216 DECLARE_HANDLE(HSTR); 217 DECLARE_HANDLE(HTASK); 218 DECLARE_HANDLE(HWINSTA); 219 DECLARE_HANDLE(HKL); 220 DECLARE_HANDLE(HMONITOR); 221 DECLARE_HANDLE(HWINEVENTHOOK); 222 DECLARE_HANDLE(HUMPD); 223 224 typedef int HFILE; 225 typedef HICON HCURSOR; 226 typedef DWORD COLORREF; 227 typedef DWORD *LPCOLORREF; 228 229 #define HFILE_ERROR ((HFILE)-1) 230 231 typedef struct tagRECT { 232 LONG left; 233 LONG top; 234 LONG right; 235 LONG bottom; 236 } RECT,*PRECT,*NPRECT,*LPRECT; 237 238 typedef const RECT *LPCRECT; 239 240 typedef struct _RECTL { 241 LONG left; 242 LONG top; 243 LONG right; 244 LONG bottom; 245 } RECTL,*PRECTL,*LPRECTL; 246 247 typedef const RECTL *LPCRECTL; 248 249 typedef struct tagPOINT { 250 LONG x; 251 LONG y; 252 } POINT,*PPOINT,*NPPOINT,*LPPOINT; 253 254 typedef struct _POINTL { 255 LONG x; 256 LONG y; 257 } POINTL,*PPOINTL; 258 259 typedef struct tagSIZE { 260 LONG cx; 261 LONG cy; 262 } SIZE,*PSIZE,*LPSIZE; 263 264 typedef SIZE SIZEL; 265 typedef SIZE *PSIZEL,*LPSIZEL; 266 267 typedef struct tagPOINTS { 268 SHORT x; 269 SHORT y; 270 } POINTS,*PPOINTS,*LPPOINTS; 271 272 typedef struct _FILETIME { 273 DWORD dwLowDateTime; 274 DWORD dwHighDateTime; 275 } FILETIME,*PFILETIME,*LPFILETIME; 276 #define _FILETIME_ 277 278 #define DM_UPDATE 1 279 #define DM_COPY 2 280 #define DM_PROMPT 4 281 #define DM_MODIFY 8 282 283 #define DM_IN_BUFFER DM_MODIFY 284 #define DM_IN_PROMPT DM_PROMPT 285 #define DM_OUT_BUFFER DM_COPY 286 #define DM_OUT_DEFAULT DM_UPDATE 287 288 #define DC_FIELDS 1 289 #define DC_PAPERS 2 290 #define DC_PAPERSIZE 3 291 #define DC_MINEXTENT 4 292 #define DC_MAXEXTENT 5 293 #define DC_BINS 6 294 #define DC_DUPLEX 7 295 #define DC_SIZE 8 296 #define DC_EXTRA 9 297 #define DC_VERSION 10 298 #define DC_DRIVER 11 299 #define DC_BINNAMES 12 300 #define DC_ENUMRESOLUTIONS 13 301 #define DC_FILEDEPENDENCIES 14 302 #define DC_TRUETYPE 15 303 #define DC_PAPERNAMES 16 304 #define DC_ORIENTATION 17 305 #define DC_COPIES 18 306 307 #ifdef __cplusplus 308 } 309 #endif 310 311 #endif /* _WINDEF_ */ 312 313