home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c083 / 19.ddi / GENINC32.PAK / WINDEF.H < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-02  |  6.7 KB  |  314 lines

  1. /*++ BUILD Version: 0001    Increment this if a change has global effects
  2.  
  3. Copyright (c) 1985-1993, Microsoft Corporation
  4.  
  5. Module Name:
  6.  
  7.     windef.h
  8.  
  9. Abstract:
  10.  
  11.     Type definitions for Windows' basic types.
  12.  
  13. --*/
  14.  
  15. #ifndef __WINDEF_H
  16. #define __WINDEF_H
  17.  
  18.  
  19. #ifndef _X86_
  20.    #define _X86_
  21. #endif
  22.  
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26.  
  27. /*
  28.  * BASETYPES is defined in ntdef.h if these types are already defined
  29.  */
  30.  
  31. #ifndef BASETYPES
  32. #define BASETYPES
  33. typedef unsigned long ULONG;
  34. typedef ULONG *PULONG;
  35. typedef unsigned short USHORT;
  36. typedef USHORT *PUSHORT;
  37. typedef unsigned char UCHAR;
  38. typedef UCHAR *PUCHAR;
  39. typedef char *PSZ;
  40. #endif  /* !BASETYPES */
  41.  
  42. #define MAX_PATH          260
  43.  
  44. #ifndef NULL
  45. #  if defined(__cplusplus) || defined(_Windows)
  46. #    define NULL 0
  47. #  else
  48. #    define NULL ((void *)0)
  49. #  endif
  50. #endif
  51.  
  52. #ifndef FALSE
  53. #define FALSE               0
  54. #endif
  55.  
  56. #ifndef TRUE
  57. #define TRUE                1
  58. #endif
  59.  
  60. #ifndef IN
  61. #define IN
  62. #endif
  63.  
  64. #ifndef OUT
  65. #define OUT
  66. #endif
  67.  
  68. #ifndef OPTIONAL
  69. #define OPTIONAL
  70. #endif
  71.  
  72. #ifdef far
  73. #undef far
  74. #endif
  75. #ifdef near
  76. #undef near
  77. #endif
  78. #ifdef pascal
  79. #undef pascal
  80. #endif
  81.  
  82. #define far
  83. #define near
  84. #if (_MSC_VER >= 800)
  85. #define pascal __stdcall
  86. #else
  87. /* #define pascal */
  88. #endif
  89.  
  90. #if defined(DOSWIN32) || defined(__BORLANDC__)
  91. #define cdecl __cdecl
  92. #ifndef CDECL
  93. #define CDECL __cdecl
  94. #endif
  95. #else
  96. #define cdecl
  97. #ifndef CDECL
  98. #define CDECL
  99. #endif
  100. #endif
  101.  
  102. #if (_MSC_VER >= 800) || defined(__BORLANDC__)
  103. #define CALLBACK    __stdcall
  104. #define WINAPI      __stdcall __import
  105. #define WINAPIV     __cdecl
  106. #define APIENTRY    WINAPI
  107. #define APIPRIVATE  __stdcall
  108. #define PASCAL      __stdcall
  109. #else
  110. #define CALLBACK
  111. #define WINAPI
  112. #define WINAPIV
  113. #define APIENTRY    WINAPI
  114. #define APIPRIVATE
  115. #define PASCAL      pascal
  116. #endif
  117.  
  118. #define FAR                 far
  119. #define NEAR                near
  120. #ifndef CONST
  121. #define CONST               const
  122. #endif
  123.  
  124. typedef unsigned long       DWORD;
  125. typedef int                 BOOL;
  126. typedef unsigned char       BYTE;
  127. typedef unsigned short      WORD;
  128. typedef float               FLOAT;
  129. typedef FLOAT               *PFLOAT;
  130. typedef BOOL near           *PBOOL;
  131. typedef BOOL far            *LPBOOL;
  132. typedef BYTE near           *PBYTE;
  133. typedef BYTE far            *LPBYTE;
  134. typedef int near            *PINT;
  135. typedef int far             *LPINT;
  136. typedef WORD near           *PWORD;
  137. typedef WORD far            *LPWORD;
  138. typedef long far            *LPLONG;
  139. typedef DWORD near          *PDWORD;
  140. typedef DWORD far           *LPDWORD;
  141. typedef void far            *LPVOID;
  142. typedef CONST void far      *LPCVOID;
  143. typedef int                 INT;
  144. typedef unsigned int        UINT;
  145. typedef unsigned int        *PUINT;
  146.  
  147. #ifdef __cplusplus
  148. }
  149. #endif
  150.  
  151. #ifndef __WINNT_H
  152. #include <winnt.h>
  153. #endif /* __WINNT_H */
  154.  
  155. #ifdef __cplusplus
  156. extern "C" {
  157. #endif
  158.  
  159. /* Types use for passing & returning polymorphic values */
  160. typedef UINT WPARAM;
  161. typedef LONG LPARAM;
  162. typedef LONG LRESULT;
  163.  
  164. #if !defined(NOMINMAX) && !defined(__cplusplus)
  165.  
  166. #ifndef max
  167. #define max(a,b)            (((a) > (b)) ? (a) : (b))
  168. #endif
  169.  
  170. #ifndef min
  171. #define min(a,b)            (((a) < (b)) ? (a) : (b))
  172. #endif
  173.  
  174. #endif  /* NOMINMAX && __cplusplus */
  175.  
  176. #define MAKEWORD(a, b)      ((WORD)(((BYTE)(a)) | (((WORD)((BYTE)(b))) << 8)))
  177. #define MAKELONG(a, b)      ((LONG)(((WORD)(a)) | (((DWORD)((WORD)(b))) << 16)))
  178. #define LOWORD(l)           ((WORD)(l))
  179. #define HIWORD(l)           ((WORD)(((DWORD)(l) >> 16) & 0xFFFF))
  180. #define LOBYTE(w)           ((BYTE)(w))
  181. #define HIBYTE(w)           ((BYTE)(((WORD)(w) >> 8) & 0xFF))
  182.  
  183.  
  184. #ifndef WIN_INTERNAL
  185. DECLARE_HANDLE            (HWND);
  186. DECLARE_HANDLE            (HHOOK);
  187. #endif
  188.  
  189. typedef WORD                ATOM;
  190.  
  191. typedef HANDLE NEAR         *SPHANDLE;
  192. typedef HANDLE FAR          *LPHANDLE;
  193. typedef HANDLE              HGLOBAL;
  194. typedef HANDLE              HLOCAL;
  195. typedef HANDLE              GLOBALHANDLE;
  196. typedef HANDLE              LOCALHANDLE;
  197. typedef int (FAR WINAPI *FARPROC)();
  198. typedef int (NEAR WINAPI *NEARPROC)();
  199. typedef int (WINAPI *PROC)();
  200.  
  201. #ifdef STRICT
  202. typedef void NEAR* HGDIOBJ;
  203. #else
  204. DECLARE_HANDLE(HGDIOBJ);
  205. #endif
  206.  
  207. DECLARE_HANDLE(HACCEL);
  208. DECLARE_HANDLE(HBITMAP);
  209. DECLARE_HANDLE(HBRUSH);
  210. DECLARE_HANDLE(HDC);
  211. DECLARE_HANDLE(HDESK);
  212. DECLARE_HANDLE(HENHMETAFILE);
  213. DECLARE_HANDLE(HFONT);
  214. DECLARE_HANDLE(HICON);
  215. DECLARE_HANDLE(HMENU);
  216. DECLARE_HANDLE(HMETAFILE);
  217. DECLARE_HANDLE(HINSTANCE);
  218. typedef HINSTANCE HMODULE;      /* HMODULEs can be used in place of HINSTANCEs */
  219. DECLARE_HANDLE(HPALETTE);
  220. DECLARE_HANDLE(HPEN);
  221. DECLARE_HANDLE(HRGN);
  222. DECLARE_HANDLE(HRSRC);
  223. DECLARE_HANDLE(HSTR);
  224. DECLARE_HANDLE(HWINSTA);
  225. DECLARE_HANDLE(HKL);
  226.  
  227. typedef int HFILE;      /* Polymorphic with C runtime file handle type */
  228. typedef HICON HCURSOR;      /* HICONs & HCURSORs are polymorphic */
  229.  
  230. typedef DWORD   COLORREF;
  231. typedef DWORD   *LPCOLORREF;
  232.  
  233. #define HFILE_ERROR ((HFILE)-1)
  234.  
  235. typedef struct tagRECT
  236. {
  237.     LONG    left;
  238.     LONG    top;
  239.     LONG    right;
  240.     LONG    bottom;
  241. } RECT, *PRECT, NEAR *NPRECT, FAR *LPRECT;
  242.  
  243. typedef struct _RECTL       /* rcl */
  244. {
  245.     LONG    left;
  246.     LONG    top;
  247.     LONG    right;
  248.     LONG    bottom;
  249. } RECTL, *PRECTL;
  250.  
  251. typedef struct tagPOINT
  252. {
  253.     LONG  x;
  254.     LONG  y;
  255. } POINT, *PPOINT, NEAR *NPPOINT, FAR *LPPOINT;
  256.  
  257. typedef struct _POINTL      /* ptl  */
  258. {
  259.     LONG  x;
  260.     LONG  y;
  261. } POINTL, *PPOINTL;
  262.  
  263. typedef struct tagSIZE
  264. {
  265.     LONG        cx;
  266.     LONG        cy;
  267. } SIZE, *PSIZE, *LPSIZE;
  268.  
  269. typedef SIZE               SIZEL;
  270. typedef SIZE               *PSIZEL;
  271.  
  272. typedef struct tagPOINTS
  273. {
  274.     SHORT   x;
  275.     SHORT   y;
  276. } POINTS, *PPOINTS, *LPPOINTS;
  277.  
  278. /* mode selections for the device mode function */
  279. #define DM_UPDATE           1
  280. #define DM_COPY             2
  281. #define DM_PROMPT           4
  282. #define DM_MODIFY           8
  283.  
  284. #define DM_IN_BUFFER        DM_MODIFY
  285. #define DM_IN_PROMPT        DM_PROMPT
  286. #define DM_OUT_BUFFER       DM_COPY
  287. #define DM_OUT_DEFAULT      DM_UPDATE
  288.  
  289. /* device capabilities indices */
  290. #define DC_FIELDS           1
  291. #define DC_PAPERS           2
  292. #define DC_PAPERSIZE        3
  293. #define DC_MINEXTENT        4
  294. #define DC_MAXEXTENT        5
  295. #define DC_BINS             6
  296. #define DC_DUPLEX           7
  297. #define DC_SIZE             8
  298. #define DC_EXTRA            9
  299. #define DC_VERSION          10
  300. #define DC_DRIVER           11
  301. #define DC_BINNAMES         12
  302. #define DC_ENUMRESOLUTIONS  13
  303. #define DC_FILEDEPENDENCIES 14
  304. #define DC_TRUETYPE         15
  305. #define DC_PAPERNAMES       16
  306. #define DC_ORIENTATION      17
  307. #define DC_COPIES           18
  308.  
  309. #ifdef __cplusplus
  310. }
  311. #endif
  312.  
  313. #endif /* _WINDEF_ */
  314.