src/win/iupwindows_info.c
char *iupdrvGetSystemName(void)
{
  OSVERSIONINFOA osvi;
  osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOA);
  GetVersionExA(&osvi);

  if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT)
  {
    if (osvi.dwMajorVersion <= 4)
      return "WinNT";

    if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 0)
      return "Win2K";

    if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion > 0)
      return "WinXP";

    if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 0)
      return "Vista";

    if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 1)
      return "Win7";

    if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 2)
      return "Win8";

    /* IMPORTANT: starting here will work only if the Manifest has been changed 
       to include Windows 8+ support. Otherwise GetVersionEx will report 6.2 */

    if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 3)
      return "Win81";

    if (osvi.dwMajorVersion == 10 && osvi.dwMinorVersion == 0)
      return "Win10";
  }

  return "Windows";
}
/* TODO: Since Windows 8.1/Visual Studio 2013 GetVersionEx is deprecated. 
         We can replace it using GetProductInfo. But for now leave it. */
Since Windows 8.1/Visual Studio 2013 GetVersionEx is deprecated.
We can replace it using GetProductInfo. But for now leave it.
Since Windows 8 . 1 / Visual Studio 2013 GetVersionEx is deprecated . We can replace it using GetProductInfo . But for now leave it .
char *iupdrvGetSystemName(void)
{
  OSVERSIONINFOA osvi;
  osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOA);
  GetVersionExA(&osvi);
  if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT)
  {
    if (osvi.dwMajorVersion <= 4)
      return "WinNT";
    if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 0)
      return "Win2K";
    if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion > 0)
      return "WinXP";
    if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 0)
      return "Vista";
    if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 1)
      return "Win7";
    if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 2)
      return "Win8";
    if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 3)
      return "Win81";
    if (osvi.dwMajorVersion == 10 && osvi.dwMinorVersion == 0)
      return "Win10";
  }
  return "Windows";
}
char * iupdrvGetSystemName ( void ) { OSVERSIONINFOA osvi ; osvi . dwOSVersionInfoSize = sizeof ( OSVERSIONINFOA ) ; GetVersionExA ( & osvi ) ; if ( osvi . dwPlatformId == VER_PLATFORM_WIN32_NT ) { if ( osvi . dwMajorVersion <= 4 ) return " " ; if ( osvi . dwMajorVersion == 5 && osvi . dwMinorVersion == 0 ) return " " ; if ( osvi . dwMajorVersion == 5 && osvi . dwMinorVersion > 0 ) return " " ; if ( osvi . dwMajorVersion == 6 && osvi . dwMinorVersion == 0 ) return " " ; if ( osvi . dwMajorVersion == 6 && osvi . dwMinorVersion == 1 ) return " " ; if ( osvi . dwMajorVersion == 6 && osvi . dwMinorVersion == 2 ) return " " ; if ( osvi . dwMajorVersion == 6 && osvi . dwMinorVersion == 3 ) return " " ; if ( osvi . dwMajorVersion == 10 && osvi . dwMinorVersion == 0 ) return " " ; } return " " ; }
TODO: Since Windows 8.1/Visual Studio 2013 GetVersionEx is deprecated.
TODO : Since Windows 8 . 1 / Visual Studio 2013 GetVersionEx is deprecated .
/* IMPORTANT: starting here will work only if the Manifest has been changed 
       to include Windows 8+ support. Otherwise GetVersionEx will report 6.2 */