The Win32 SDK does not come in different versions for different platforms. For example, if you choose to develop for Windows 98, you should work with the same SDK as you would when developing for Windows XP. The solution Microsoft offers to enforce a minimum system requirement for a particular application works through a set of preprocessor macros used widely in the Windows header files. These macros are WINVER, _WIN32_WINDOWS, _WIN32_WINNT, and _WIN32_IE. You should define these macros to a hexadecimal number that varies for each platform. Here’s a table that indicates which macros need to be defined for developing for a particular platform, and what number should they be defined to.
|Windows 95 and NT 4.0||0x0400||n/a||n/a||n/a|
|Windows 98 and NT 4.0||0x0400||0x0410||n/a||n/a|
|Windows NT 4.0||0x0400||n/a||0x0400||n/a|
|Windows XP and Windows .NET Server||0x0501||n/a||0x0501||n/a|
|Internet Explorer 3.0, 3.01, 3.02||n/a||n/a||n/a||0x0300|
|Internet Explorer 4.0||n/a||n/a||n/a||0x0400|
|Internet Explorer 4.01||n/a||n/a||n/a||0x0401|
|Internet Explorer 5.0, 5.0a, 5.0b||n/a||n/a||n/a||0x0500|
|Internet Explorer 5.01, 5.5||n/a||n/a||n/a||0x0501|
|Internet Explorer 6.0||n/a||n/a||n/a||0x0560
In order to use the above macros, you should define them before including any other header files. For example, if you want to develop an application targeting Windows 98, Me, NT 4.0, 2000, XP, with a minimum of Internet Explorer 5.0 installed, you should include Windows headers like this:
#define WINVER 0x0400
#define _WIN32_WINDOWS 0x0410
#define _WIN32_IE 0x0500
// include other necessary headers as well...
You should find the minimum system requirement, and define the macros dependently. In the above example, the minimum system requirement is Windows 98 and NT 4.0 with Internet Explorer 5.0 installed. In other words, any application developed with regard to those requirements is compatible with higher system versions.
Note that this is only a compile-time check. You should perform run-time checks as well. By being strict in defining the above macros as necessary, you ensure that you won’t use any features that are not present in the target platform.