You can also do

    #define NOMINMAX

before #include <windows.h> .