#define _WIN32_WINNT 0x501
przed jakimkolwiek include'em.
jeśli masz w projekcie precompiled header (stdafx.h
) to dodaj tam i będzie spokój.
a swoją drogą VS2010 domyślnie w nowym projekcie definiuje tę stałą (na 0x601
o ile się nie mylę) więc musiałeś celowo namieszać.
wartość oznacza jaką wersję Windowsa ustalasz jako minimalne wymagania twojego programu:
0x500 | Windows 2000
0x501 | Windows XP x86
0x502 | Windows XP x64, Windows Server 2003, Windows Server 2003 R2
0x600 | Windows Vista, Windows Server 2008
0x601 | Windows 7, Windows Server 2008 R2
0x602 | Windows 8, Windows Server 2012
0x603 | Windows 8.1, Windows Server 2012 R2
Program który definiuje np. 0x600
może potem nie działać pod XP i nie będzie wiadomo dlaczego.