afxv_w32.h 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  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. #define _WIN32_WINDOWS 0x0500
  106. #include <windows.h>
  107. #undef WM_MOUSELAST
  108. #define WM_MOUSELAST 0x0209
  109. #include <zmouse.h>
  110. struct HKEY__;
  111. typedef struct HKEY__ *HKEY;
  112. #ifndef _INC_COMMCTRL
  113. #include <commctrl.h>
  114. // Note: We must avoid using TB_ADDBUTTONW and TB_INSERTBUTTONW in the Unicode
  115. // build or else MFC42U.DLL will not be compatible with pre-IE4 versions of
  116. // COMCTL32.DLL.
  117. #ifdef TB_ADDBUTTONSA
  118. #undef TB_ADDBUTTONS
  119. #define TB_ADDBUTTONS TB_ADDBUTTONSA
  120. #endif
  121. #ifdef TB_INSERTBUTTONA
  122. #undef TB_INSERTBUTTON
  123. #define TB_INSERTBUTTON TB_INSERTBUTTONA
  124. #endif
  125. #endif
  126. #ifndef EXPORT
  127. #define EXPORT
  128. #endif
  129. #ifndef _INC_TCHAR
  130. #include <tchar.h> // used for ANSI v.s. UNICODE abstraction
  131. #endif
  132. #ifdef _MBCS
  133. #ifndef _INC_MBCTYPE
  134. #include <mbctype.h>
  135. #endif
  136. #ifndef _INC_MBSTRING
  137. #include <mbstring.h>
  138. #endif
  139. #endif
  140. /////////////////////////////////////////////////////////////////////////////
  141. // Now for the Windows API specific parts
  142. // WM_CTLCOLOR for 16 bit API compatability
  143. #define WM_CTLCOLOR 0x0019
  144. // Win32 uses macros with parameters for this, which breaks C++ code.
  145. #ifdef GetWindowTask
  146. #undef GetWindowTask
  147. AFX_INLINE HTASK GetWindowTask(HWND hWnd)
  148. { return (HTASK)::GetWindowThreadProcessId(hWnd, NULL); }
  149. #endif
  150. // Win32 uses macros with parameters for this, which breaks C++ code.
  151. #ifdef GetNextWindow
  152. #undef GetNextWindow
  153. AFX_INLINE HWND GetNextWindow(HWND hWnd, UINT nDirection)
  154. { return ::GetWindow(hWnd, nDirection); }
  155. #endif
  156. // Avoid Win95 mapping CToolBar::DrawState to DrawState[A/W]
  157. #ifdef DrawState
  158. #undef DrawState
  159. AFX_INLINE BOOL WINAPI DrawState(HDC hdc, HBRUSH hbr, DRAWSTATEPROC lpOutputFunc,
  160. LPARAM lData, WPARAM wData, int x, int y, int cx, int cy, UINT fuFlags)
  161. #ifdef UNICODE
  162. { return ::DrawStateW(hdc, hbr, lpOutputFunc, lData, wData, x, y, cx, cy,
  163. fuFlags); }
  164. #else
  165. { return ::DrawStateA(hdc, hbr, lpOutputFunc, lData, wData, x, y, cx, cy,
  166. fuFlags); }
  167. #endif
  168. #endif
  169. // Avoid Win95 mapping CStatusBar::DrawStatusText to DrawStatusText[A/W]
  170. #ifdef DrawStatusText
  171. #undef DrawStatusText
  172. AFX_INLINE void WINAPI DrawStatusText(HDC hDC, LPRECT lprc, LPCTSTR szText,
  173. UINT uFlags)
  174. #ifdef UNICODE
  175. { ::DrawStatusTextW(hDC, lprc, szText, uFlags); }
  176. #else
  177. { ::DrawStatusTextA(hDC, lprc, szText, uFlags); }
  178. #endif
  179. #endif
  180. // FreeResource is not required on Win32 platforms
  181. #undef FreeResource
  182. AFX_INLINE BOOL WINAPI FreeResource(HGLOBAL) { return TRUE; }
  183. // UnlockResource is not required on Win32 platforms
  184. #undef UnlockResource
  185. AFX_INLINE int WINAPI UnlockResource(HGLOBAL) { return 0; }
  186. /////////////////////////////////////////////////////////////////////////////