home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / BC_502 / MFCINC.PAK / AFXV_W32.H < prev    next >
Encoding:
C/C++ Source or Header  |  1997-05-06  |  4.9 KB  |  209 lines

  1. // This is a part of the Microsoft Foundation Classes C++ library.
  2. // Copyright (C) 1992-1995 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. #ifdef _MAC
  111. #define _WIN32NLS
  112. #define _WIN32REG
  113. #define _WLM_NOFORCE_LIBS
  114. #ifdef _AFXDLL
  115. #define _WLMDLL
  116. #endif
  117. #endif
  118.  
  119. /////////////////////////////////////////////////////////////////////////////
  120. // Turn off warnings for /W4
  121. // To resume any of these warning: #pragma warning(default: 4xxx)
  122. // which should be placed after the AFX include files
  123.  
  124. #ifndef ALL_WARNINGS
  125. #pragma warning(disable: 4201)  // winnt.h uses nameless structs
  126. #endif
  127.  
  128. #include <windows.h>
  129.  
  130. struct HKEY__;
  131. typedef struct HKEY__ *HKEY;
  132.  
  133. #ifndef _INC_COMMCTRL
  134.     #include <commctrl.h>
  135. #endif
  136.  
  137. #ifndef EXPORT
  138. #define EXPORT
  139. #endif
  140.  
  141. #ifndef _INC_TCHAR
  142.     #include <tchar.h>      // used for ANSI v.s. UNICODE abstraction
  143. #endif
  144. #ifdef _MBCS
  145. #ifndef _INC_MBCTYPE
  146.     #include <mbctype.h>
  147. #endif
  148. #ifndef _INC_MBSTRING
  149.     #include <mbstring.h>
  150. #endif
  151. #endif
  152.  
  153. /////////////////////////////////////////////////////////////////////////////
  154. // Now for the Windows API specific parts
  155.  
  156. // WM_CTLCOLOR for 16 bit API compatability
  157. #define WM_CTLCOLOR     0x0019
  158.  
  159. // Win32 uses macros with parameters for this, which breaks C++ code.
  160. #ifdef GetWindowTask
  161. #undef GetWindowTask
  162. inline HTASK GetWindowTask(HWND hWnd)
  163.     { return (HTASK)::GetWindowThreadProcessId(hWnd, NULL); }
  164. #endif
  165.  
  166. // Win32 uses macros with parameters for this, which breaks C++ code.
  167. #ifdef GetNextWindow
  168. #undef GetNextWindow
  169. inline HWND GetNextWindow(HWND hWnd, UINT nDirection)
  170.     { return ::GetWindow(hWnd, nDirection); }
  171. #endif
  172.  
  173. // Avoid Win95 mapping CToolBar::DrawState to DrawState[A/W]
  174. #ifdef DrawState
  175. #undef DrawState
  176. inline BOOL WINAPI DrawState(HDC hdc, HBRUSH hbr, DRAWSTATEPROC lpOutputFunc,
  177.     LPARAM lData, WPARAM wData, int x, int y, int cx, int cy, UINT fuFlags)
  178. #ifdef UNICODE
  179.     { return ::DrawStateW(hdc, hbr, lpOutputFunc, lData, wData, x, y, cx, cy,
  180.         fuFlags); }
  181. #else
  182.     { return ::DrawStateA(hdc, hbr, lpOutputFunc, lData, wData, x, y, cx, cy,
  183.         fuFlags); }
  184. #endif
  185. #endif
  186.  
  187. // Avoid Win95 mapping CStatusBar::DrawStatusText to DrawStatusText[A/W]
  188. #ifdef DrawStatusText
  189. #undef DrawStatusText
  190. inline void WINAPI DrawStatusText(HDC hDC, LPRECT lprc, LPCTSTR szText,
  191.     UINT uFlags)
  192. #ifdef UNICODE
  193.     { ::DrawStatusTextW(hDC, lprc, szText, uFlags); }
  194. #else
  195.     { ::DrawStatusTextA(hDC, lprc, szText, uFlags); }
  196. #endif
  197. #endif
  198.  
  199. #ifndef _MAC
  200. // FreeResource is not required except on Mac platforms
  201. #undef FreeResource
  202. inline BOOL WINAPI FreeResource(HGLOBAL) { return TRUE; }
  203. // UnlockResource is not required except on Mac platforms
  204. #undef UnlockResource
  205. inline int WINAPI UnlockResource(HGLOBAL) { return 0; }
  206. #endif
  207.  
  208. /////////////////////////////////////////////////////////////////////////////
  209.