How to tame the Windows headers (useful defines)?(如何驯服 Windows 标头(有用的定义)?)
问题描述
在这个问题的答案之一中jalf 谈到了有用的定义 NOMINMAX
,它可以防止不需要的定义 min/max 宏.是否有其他有用的定义可以帮助控制 windows.h
(或其他 Windows 标头,例如 Microsoft C 运行时标头或 STL 实现)行为?
In one of the answers to this question jalf spoke about useful define NOMINMAX
, that could prevent from unwanted defining min/max macros. Are there other useful defines that can help to control windows.h
(or other Windows headers, for instance Microsoft C Runtime headers or STL implementation) behavior?
推荐答案
最常用的可能是 WIN32_LEAN_AND_MEAN
- 它禁用 API 中很少使用的部分.您可以在 MSDN 的 使用 Windows 标头.
The most commonly used is probably WIN32_LEAN_AND_MEAN
- it disables rarely used parts of the API. You can find more on MSDN's Using the Windows Headers.
我记错了 MSDN 列出了这些定义,所以这里是 windows.h 中的列表:
I remembered wrong about MSDN listing those defines, so here's list from windows.h:
这篇关于如何驯服 Windows 标头(有用的定义)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!