home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / mfc / include / afxv_w32.h < prev    next >
C/C++ Source or Header  |  1998-06-16  |  5KB  |  217 lines

  1. // This is a part of the Microsoft Foundation Classes C++ library.
  2. // Copyright (C) 1992-1998 Microsoft Corporation
  3. // All rights reserved.
  4. //
  5. // This source code is only intended as a supplement to the
  6. // Microsoft Foundation Classes Reference and related
  7. // electronic documentation provided with the library.
  8. // See these sources for detailed information regarding the
  9. // Microsoft Foundation Classes product.
  10.  
  11. // afxv_w32.h - target version/configuration control for Win32
  12.  
  13. #ifdef _WINDOWS_
  14.     #error WINDOWS.H already included.  MFC apps must not #include <windows.h>
  15. #endif
  16.  
  17. // STRICT is the only supported option (NOSTRICT is no longer supported)
  18. #ifndef STRICT
  19. #define STRICT 1
  20. #endif
  21.  
  22. // certain parts of WINDOWS.H are necessary
  23. #undef NOKERNEL
  24. #undef NOGDI
  25. #undef NOUSER
  26. #undef NODRIVERS
  27. #undef NOLOGERROR
  28. #undef NOPROFILER
  29. #undef NOMEMMGR
  30. #undef NOLFILEIO
  31. #undef NOOPENFILE
  32. #undef NORESOURCE
  33. #undef NOATOM
  34. #undef NOLANGUAGE
  35. #undef NOLSTRING
  36. #undef NODBCS
  37. #undef NOKEYBOARDINFO
  38. #undef NOGDICAPMASKS
  39. #undef NOCOLOR
  40. #undef NOGDIOBJ
  41. #undef NODRAWTEXT
  42. #undef NOTEXTMETRIC
  43. #undef NOSCALABLEFONT
  44. #undef NOBITMAP
  45. #undef NORASTEROPS
  46. #undef NOMETAFILE
  47. #undef NOSYSMETRICS
  48. #undef NOSYSTEMPARAMSINFO
  49. #undef NOMSG
  50. #undef NOWINSTYLES
  51. #undef NOWINOFFSETS
  52. #undef NOSHOWWINDOW
  53. #undef NODEFERWINDOWPOS
  54. #undef NOVIRTUALKEYCODES
  55. #undef NOKEYSTATES
  56. #undef NOWH
  57. #undef NOMENUS
  58. #undef NOSCROLL
  59. #undef NOCLIPBOARD
  60. #undef NOICONS
  61. #undef NOMB
  62. #undef NOSYSCOMMANDS
  63. #undef NOMDI
  64. #undef NOCTLMGR
  65. #undef NOWINMESSAGES
  66.  
  67. #ifndef WIN32
  68. #define WIN32
  69. #endif
  70.  
  71. #ifndef WIN32_LEAN_AND_MEAN
  72. #define WIN32_LEAN_AND_MEAN
  73. #endif
  74.  
  75. #ifdef _UNICODE
  76. #ifndef UNICODE
  77. #define UNICODE         // UNICODE is used by Windows headers
  78. #endif
  79. #endif
  80.  
  81. #ifdef UNICODE
  82. #ifndef _UNICODE
  83. #define _UNICODE        // _UNICODE is used by C-runtime/MFC headers
  84. #endif
  85. #endif
  86.  
  87. #ifdef VC_EXTRALEAN
  88. #define WIN32_EXTRA_LEAN
  89. #define NOSERVICE
  90. #define NOMCX
  91. #define NOIME
  92. #define NOSOUND
  93. #define NOCOMM
  94. #define NOKANJI
  95. #define NORPC
  96. #define NOPROXYSTUB
  97. #define NOIMAGE
  98. #define NOTAPE
  99.  
  100. #ifndef NO_ANSIUNI_ONLY
  101. #ifdef _UNICODE
  102. #define UNICODE_ONLY
  103. #else
  104. #define ANSI_ONLY
  105. #endif
  106. #endif //!NO_ANSIUNI_ONLY
  107.  
  108. #endif //VC_EXTRALEAN
  109.  
  110. /////////////////////////////////////////////////////////////////////////////
  111. // Turn off warnings for /W4
  112. // To resume any of these warning: #pragma warning(default: 4xxx)
  113. // which should be placed after the AFX include files
  114.  
  115. #ifndef ALL_WARNINGS
  116. #pragma warning(disable: 4201)  // winnt.h uses nameless structs
  117. #endif
  118.  
  119. #define _WIN32_WINDOWS 0x0500
  120. #include <windows.h>
  121.  
  122. #undef WM_MOUSELAST
  123. #define WM_MOUSELAST 0x0209
  124.  
  125. #include <zmouse.h>
  126.  
  127. struct HKEY__;
  128. typedef struct HKEY__ *HKEY;
  129.  
  130. #ifndef _INC_COMMCTRL
  131.     #include <commctrl.h>
  132.  
  133.     // Note: We must avoid using TB_ADDBUTTONW and TB_INSERTBUTTONW in the Unicode
  134.     //  build or else MFC42U.DLL will not be compatible with pre-IE4 versions of
  135.     //  COMCTL32.DLL.
  136.     #ifdef TB_ADDBUTTONSA
  137.         #undef TB_ADDBUTTONS
  138.         #define TB_ADDBUTTONS TB_ADDBUTTONSA
  139.     #endif
  140.  
  141.     #ifdef TB_INSERTBUTTONA
  142.         #undef TB_INSERTBUTTON
  143.         #define TB_INSERTBUTTON TB_INSERTBUTTONA
  144.     #endif
  145. #endif
  146.  
  147. #ifndef EXPORT
  148. #define EXPORT
  149. #endif
  150.  
  151. #ifndef _INC_TCHAR
  152.     #include <tchar.h>      // used for ANSI v.s. UNICODE abstraction
  153. #endif
  154. #ifdef _MBCS
  155. #ifndef _INC_MBCTYPE
  156.     #include <mbctype.h>
  157. #endif
  158. #ifndef _INC_MBSTRING
  159.     #include <mbstring.h>
  160. #endif
  161. #endif
  162.  
  163. /////////////////////////////////////////////////////////////////////////////
  164. // Now for the Windows API specific parts
  165.  
  166. // WM_CTLCOLOR for 16 bit API compatability
  167. #define WM_CTLCOLOR     0x0019
  168.  
  169. // Win32 uses macros with parameters for this, which breaks C++ code.
  170. #ifdef GetWindowTask
  171. #undef GetWindowTask
  172. AFX_INLINE HTASK GetWindowTask(HWND hWnd)
  173.     { return (HTASK)::GetWindowThreadProcessId(hWnd, NULL); }
  174. #endif
  175.  
  176. // Win32 uses macros with parameters for this, which breaks C++ code.
  177. #ifdef GetNextWindow
  178. #undef GetNextWindow
  179. AFX_INLINE HWND GetNextWindow(HWND hWnd, UINT nDirection)
  180.     { return ::GetWindow(hWnd, nDirection); }
  181. #endif
  182.  
  183. // Avoid Win95 mapping CToolBar::DrawState to DrawState[A/W]
  184. #ifdef DrawState
  185. #undef DrawState
  186. AFX_INLINE BOOL WINAPI DrawState(HDC hdc, HBRUSH hbr, DRAWSTATEPROC lpOutputFunc,
  187.     LPARAM lData, WPARAM wData, int x, int y, int cx, int cy, UINT fuFlags)
  188. #ifdef UNICODE
  189.     { return ::DrawStateW(hdc, hbr, lpOutputFunc, lData, wData, x, y, cx, cy,
  190.         fuFlags); }
  191. #else
  192.     { return ::DrawStateA(hdc, hbr, lpOutputFunc, lData, wData, x, y, cx, cy,
  193.         fuFlags); }
  194. #endif
  195. #endif
  196.  
  197. // Avoid Win95 mapping CStatusBar::DrawStatusText to DrawStatusText[A/W]
  198. #ifdef DrawStatusText
  199. #undef DrawStatusText
  200. AFX_INLINE void WINAPI DrawStatusText(HDC hDC, LPRECT lprc, LPCTSTR szText,
  201.     UINT uFlags)
  202. #ifdef UNICODE
  203.     { ::DrawStatusTextW(hDC, lprc, szText, uFlags); }
  204. #else
  205.     { ::DrawStatusTextA(hDC, lprc, szText, uFlags); }
  206. #endif
  207. #endif
  208.  
  209. // FreeResource is not required on Win32 platforms
  210. #undef FreeResource
  211. AFX_INLINE BOOL WINAPI FreeResource(HGLOBAL) { return TRUE; }
  212. // UnlockResource is not required on Win32 platforms
  213. #undef UnlockResource
  214. AFX_INLINE int WINAPI UnlockResource(HGLOBAL) { return 0; }
  215.  
  216. /////////////////////////////////////////////////////////////////////////////
  217.