Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

224 lines
5.1 KiB

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