Microsoft KB Archive/169088

From BetaArchive Wiki

INFO: Using _WIN32_WINNT with the Platform SDK Header Files


The information in this article applies to:

  • Microsoft Platform Software Development Kit (SDK)


The header files of the Platform SDK now include _WIN32_WINNT guards. This constant should be defined in your makefile (either app specific, or for the whole project) so that you can take advantage of features that are specific to Windows NT/2000. In the Platform SDK, _WIN32_WINNT is defined in Win32.mak (conditionally, depending on the platform you are targetting). More information about _WIN32_WINNT is provided in the release notes for the Platform SDK.


There are several features of Windows NT 4.0 and Windows 2000 that are not in previous version of Windows NT or in Windows 95. If you are developing code that uses the advanced features of the operating system, then you should define the _WIN32_WINNT constant to be 0x0400 for Windows NT 4.0 or 0x0500 for Windows 2000 (or greater for future features).

A partial list of areas that are affected by this definition is:

Distributed Component Object Model (DCOM),

several new window messages (WM_MOUSEWHEEL for instance),
Waitable Timer API's,
CopyFileEx API's,
Fiber API's,

FindFirst/NextFileEx API's.

Search the Platform SDK header files for a complete reference of the portions of the SDK that are affected by this definition.

For instance, placing the following in your source code will include the proper function prototypes and constant definitions for your code to use the advanced components of Windows NT:

   #define _WIN32_WINNT 0x0400
   #include <windows.h> 

You may also make the definition in the makefile or project settings so that all source files can take advantage of the advanced components.

Keep in mind that making this definition and using advanced components of the operating system makes your code usable only on Windows NT 4.0 or later. If you want to make your code compatible with all Win32 platforms, then you should not use this definition or use the advanced features unless the code is running on a platform that supports the features. You may check the version of Windows programmatically and link dynamically to the proper API's if you detect that the platform supports them. This allows your code to degrade to more basic functionality if the advanced features of the operating system are not available.


Please see the Platform SDK release notes for complete and up-to-date information regarding the use of _WIN32_WINNT.

Additional query words: bse ntonly

Keywords : kbprogramming kbusage kbKernBase kbSDKWin32 kbDSupport kbGrpDSKernBase
Issue type : kbinfo
Technology : kbWin32SDKSearch kbAudDeveloper kbSDKSearch

Last Reviewed: December 21, 1999
© 2001 Microsoft Corporation. All rights reserved. Terms of Use.