1 /****************************************************************************
2 *                                                                                                                             *
3 * windef.h -- Basic Windows Type Definitions                                                     *
4 *                                                                                                                             *
5 * Copyright (c) Microsoft Corporation. All rights reserved.                            *
6 *                                                                                                                             *
7 ****************************************************************************/
8
9
10 #ifndef _WINDEF_
11 #define _WINDEF_
12 #pragma once
13
14 #ifndef NO_STRICT
15 #ifndef STRICT
16 #define STRICT 1
17 #endif
18 #endif /* NO_STRICT */
19
20 // Win32 defines _WIN32 automatically,
21 // but Macintosh doesn't, so if we are using
22 // Win32 Functions, we must do it here
23
24 #ifdef _MAC
25 #ifndef _WIN32
26 #define _WIN32
27 #endif
28 #endif //_MAC
29
30 #ifndef WIN32
31 #define WIN32
32 #endif
33
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37
38 #ifndef WINVER
39 #define WINVER 0x0500
40 #endif /* WINVER */
41
42 /*
43  * BASETYPES is defined in ntdef.h if these types are already defined
44  */
45
46 #ifndef BASETYPES
47 #define BASETYPES
48 typedef unsigned long ULONG;
49 typedef ULONG *PULONG;
50 typedef unsigned short USHORT;
51 typedef USHORT *PUSHORT;
52 typedef unsigned char UCHAR;
53 typedef UCHAR *PUCHAR;
54 typedef char *PSZ;
55 #endif  /* !BASETYPES */
56
57 #define MAX_PATH                260
58
59 #ifndef NULL
60 #ifdef __cplusplus
61 #define NULL      0
62 #else
63 #define NULL      ((void *)0)
64 #endif
65 #endif
66
67 #ifndef FALSE
68 #define FALSE                         0
69 #endif
70
71 #ifndef TRUE
72 #define TRUE                          1
73 #endif
74
75 #ifndef IN
76 #define IN
77 #endif
78
79 #ifndef OUT
80 #define OUT
81 #endif
82
83 #ifndef OPTIONAL
84 #define OPTIONAL
85 #endif
86
87 #undef far
88 #undef near
89 #undef pascal
90
91 #define far
92 #define near
93 #if (!defined(_MAC)) && ((_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED))
94 #define pascal __stdcall
95 #else
96 #define pascal
97 #endif
98
99 #if defined(DOSWIN32) || defined(_MAC)
100 #define cdecl _cdecl
101 #ifndef CDECL
102 #define CDECL _cdecl
103 #endif
104 #else
105 #define cdecl
106 #ifndef CDECL
107 #define CDECL
108 #endif
109 #endif
110
111 #ifdef _MAC
112 #define CALLBACK      PASCAL
113 #define WINAPI          CDECL
114 #define WINAPIV        CDECL
115 #define APIENTRY      WINAPI
116 #define APIPRIVATE  CDECL
117 #ifdef _68K_
118 #define PASCAL          __pascal
119 #else
120 #define PASCAL
121 #endif
122 #elif (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED)
123 #define CALLBACK      __stdcall
124 #define WINAPI          __stdcall
125 #define WINAPIV        __cdecl
126 #define APIENTRY      WINAPI
127 #define APIPRIVATE  __stdcall
128 #define PASCAL          __stdcall
129 #else
130 #define CALLBACK
131 #define WINAPI
132 #define WINAPIV
133 #define APIENTRY      WINAPI
134 #define APIPRIVATE
135 #define PASCAL          pascal
136 #endif
137
138 #ifdef _M_CEE_PURE
139 #define WINAPI_INLINE  __clrcall
140 #else
141 #define WINAPI_INLINE  WINAPI
142 #endif
143
144 #undef FAR
145 #undef  NEAR
146 #define FAR                            far
147 #define NEAR                          near
148 #ifndef CONST
149 #define CONST                         const
150 #endif
151
152 typedef unsigned long           DWORD;
153 typedef int                            BOOL;
154 typedef unsigned char           BYTE;
155 typedef unsigned short          WORD;
156 typedef float                         FLOAT;
157 typedef FLOAT                         *PFLOAT;
158 typedef BOOL near                  *PBOOL;
159 typedef BOOL far                    *LPBOOL;
160 typedef BYTE near                  *PBYTE;
161 typedef BYTE far                    *LPBYTE;
162 typedef int near                    *PINT;
163 typedef int far                     *LPINT;
164 typedef WORD near                  *PWORD;
165 typedef WORD far                    *LPWORD;
166 typedef long far                    *LPLONG;
167 typedef DWORD near                *PDWORD;
168 typedef DWORD far                  *LPDWORD;
169 typedef void far                    *LPVOID;
170 typedef CONST void far          *LPCVOID;
171
172 typedef int                            INT;
173 typedef unsigned int             UINT;
174 typedef unsigned int             *PUINT;
175
176 #ifndef NT_INCLUDED
177 #include <winnt.h>
178 #endif /* NT_INCLUDED */
179
180 #include <specstrings.h>
181
182 /* Types use for passing & returning polymorphic values */
183 typedef UINT_PTR                    WPARAM;
184 typedef LONG_PTR                    LPARAM;
185 typedef LONG_PTR                    LRESULT;
186
187 #ifndef NOMINMAX
188
189 #ifndef max
190 #define max(a,b)                    (((a) > (b)) ? (a) : (b))
191 #endif
192
193 #ifndef min
194 #define min(a,b)                    (((a) < (b)) ? (a) : (b))
195 #endif
196
197 #endif  /* NOMINMAX */
198
199 #define MAKEWORD(a, b)          ((WORD)(((BYTE)(((DWORD_PTR)(a)) & 0xff)) | ((WORD)((BYTE)(((DWORD_PTR)(b)) & 0xff))) << 8))
200 #define MAKELONG(a, b)          ((LONG)(((WORD)(((DWORD_PTR)(a)) & 0xffff)) | ((DWORD)((WORD)(((DWORD_PTR)(b)) & 0xffff))) << 16))
201 #define LOWORD(l)                  ((WORD)(((DWORD_PTR)(l)) & 0xffff))
202 #define HIWORD(l)                  ((WORD)((((DWORD_PTR)(l)) >> 16) & 0xffff))
203 #define LOBYTE(w)                  ((BYTE)(((DWORD_PTR)(w)) & 0xff))
204 #define HIBYTE(w)                  ((BYTE)((((DWORD_PTR)(w)) >> 8) & 0xff))
205
206
207 #ifndef WIN_INTERNAL
208 DECLARE_HANDLE                    (HWND);
209 DECLARE_HANDLE                    (HHOOK);
210 #ifdef WINABLE
211 DECLARE_HANDLE                    (HEVENT);
212 #endif
213 #endif
214
215 typedef WORD                          ATOM;
216
217 typedef HANDLE NEAR               *SPHANDLE;
218 typedef HANDLE FAR                *LPHANDLE;
219 typedef HANDLE                       HGLOBAL;
220 typedef HANDLE                       HLOCAL;
221 typedef HANDLE                       GLOBALHANDLE;
222 typedef HANDLE                       LOCALHANDLE;
223 #ifndef _MANAGED
224 #ifndef _MAC
225 #ifdef _WIN64
226 typedef INT_PTR (FAR WINAPI *FARPROC)();
227 typedef INT_PTR (NEAR WINAPI *NEARPROC)();
228 typedef INT_PTR (WINAPI *PROC)();
229 #else
230 typedef int (FAR WINAPI *FARPROC)();
231 typedef int (NEAR WINAPI *NEARPROC)();
232 typedef int (WINAPI *PROC)();
233 #endif  // _WIN64
234 #else
235 typedef int (CALLBACK *FARPROC)();
236 typedef int (CALLBACK *NEARPROC)();
237 typedef int (CALLBACK *PROC)();
238 #endif
239 #else
240 typedef INT_PTR (WINAPI *FARPROC)(void);
241 typedef INT_PTR (WINAPI *NEARPROC)(void);
242 typedef INT_PTR (WINAPI *PROC)(void);
243 #endif
244
245 #if !defined(_MAC) || !defined(GDI_INTERNAL)
246 #ifdef STRICT
247 typedef void NEAR* HGDIOBJ;
248 #else
249 DECLARE_HANDLE(HGDIOBJ);
250 #endif
251 #endif
252
253 DECLARE_HANDLE(HKEY);
254 typedef HKEY *PHKEY;
255
256 #if !defined(_MAC) || !defined(WIN_INTERNAL)
257 DECLARE_HANDLE(HACCEL);
258 #endif
259 #if !defined(_MAC) || !defined(GDI_INTERNAL)
260 DECLARE_HANDLE(HBITMAP);
261 DECLARE_HANDLE(HBRUSH);
262 #endif
263 #if(WINVER >= 0x0400)
264 DECLARE_HANDLE(HCOLORSPACE);
265 #endif /* WINVER >= 0x0400 */
266 #if !defined(_MAC) || !defined(GDI_INTERNAL)
267 DECLARE_HANDLE(HDC);
268 #endif
269 DECLARE_HANDLE(HGLRC);                // OpenGL
270 DECLARE_HANDLE(HDESK);
271 DECLARE_HANDLE(HENHMETAFILE);
272 #if !defined(_MAC) || !defined(GDI_INTERNAL)
273 DECLARE_HANDLE(HFONT);
274 #endif
275 DECLARE_HANDLE(HICON);
276 #if !defined(_MAC) || !defined(WIN_INTERNAL)
277 DECLARE_HANDLE(HMENU);
278 #endif
279 DECLARE_HANDLE(HMETAFILE);
280 DECLARE_HANDLE(HINSTANCE);
281 typedef HINSTANCE HMODULE;          /* HMODULEs can be used in place of HINSTANCEs */
282 #if !defined(_MAC) || !defined(GDI_INTERNAL)
283 DECLARE_HANDLE(HPALETTE);
284 DECLARE_HANDLE(HPEN);
285 #endif
286 DECLARE_HANDLE(HRGN);
287 DECLARE_HANDLE(HRSRC);
288 DECLARE_HANDLE(HSPRITE);
289 DECLARE_HANDLE(HSTR);
290 DECLARE_HANDLE(HTASK);
291 DECLARE_HANDLE(HWINSTA);
292 DECLARE_HANDLE(HKL);
293
294 #if(WINVER >= 0x0400)
295 DECLARE_HANDLE(HWINEVENTHOOK);
296 #endif /* WINVER >= 0x0400 */
297
298 #if(WINVER >= 0x0500)
299 #ifndef _MAC
300 DECLARE_HANDLE(HMONITOR);
301 #endif
Lines 302 ... 311 are skipped.
312
313 typedef DWORD     COLORREF;
314 typedef DWORD     *LPCOLORREF;
315
316 #define HFILE_ERROR ((HFILE)-1)
317
318 typedef struct tagRECT
319 {
320       LONG      left;
321       LONG      top;
322       LONG      right;
323       LONG      bottom;
324 } RECT, *PRECT, NEAR *NPRECT, FAR *LPRECT;
325
326 typedef const RECT FAR* LPCRECT;
327
328 typedef struct _RECTL           /* rcl */
329 {
330       LONG      left;
331       LONG      top;
332       LONG      right;
333       LONG      bottom;
334 } RECTL, *PRECTL, *LPRECTL;
335
336 typedef const RECTL FAR* LPCRECTL;
337
338 typedef struct tagPOINT
339 {
340       LONG  x;
341       LONG  y;
342 } POINT, *PPOINT, NEAR *NPPOINT, FAR *LPPOINT;
343
344 typedef struct _POINTL          /* ptl  */
345 {
346       LONG  x;
347       LONG  y;
348 } POINTL, *PPOINTL;
349
350 typedef struct tagSIZE
351 {
352       LONG             cx;
353       LONG             cy;
354 } SIZE, *PSIZE, *LPSIZE;
355
356 typedef SIZE                         SIZEL;
357 typedef SIZE                         *PSIZEL, *LPSIZEL;
358
359 typedef struct tagPOINTS
360 {
361 #ifndef _MAC
362       SHORT     x;
363       SHORT     y;
364 #else
365       SHORT     y;
366       SHORT     x;
367 #endif
368 } POINTS, *PPOINTS, *LPPOINTS;
369
370 //
371 //  File System time stamps are represented with the following structure:
372 //
373
374 typedef struct _FILETIME {
375       DWORD dwLowDateTime;
376       DWORD dwHighDateTime;
377 } FILETIME, *PFILETIME, *LPFILETIME;
378 #define _FILETIME_
379
380
381 /* mode selections for the device mode function */
382 #define DM_UPDATE                  1
383 #define DM_COPY                     2
384 #define DM_PROMPT                  4
385 #define DM_MODIFY                  8
386
387 #define DM_IN_BUFFER             DM_MODIFY
388 #define DM_IN_PROMPT             DM_PROMPT
389 #define DM_OUT_BUFFER           DM_COPY
390 #define DM_OUT_DEFAULT          DM_UPDATE
391
392 /* device capabilities indices */
393 #define DC_FIELDS                  1
394 #define DC_PAPERS                  2
395 #define DC_PAPERSIZE             3
396 #define DC_MINEXTENT             4
397 #define DC_MAXEXTENT             5
398 #define DC_BINS                     6
399 #define DC_DUPLEX                  7
400 #define DC_SIZE                     8
401 #define DC_EXTRA                    9
402 #define DC_VERSION                10
403 #define DC_DRIVER                  11
404 #define DC_BINNAMES               12
405 #define DC_ENUMRESOLUTIONS  13
406 #define DC_FILEDEPENDENCIES 14
407 #define DC_TRUETYPE               15
408 #define DC_PAPERNAMES           16
409 #define DC_ORIENTATION          17
410 #define DC_COPIES                  18
411
412 #ifdef __cplusplus
413 }
414 #endif
415
416 #endif /* _WINDEF_ */
417
418
419