Borland C ++ Builder FAQ
The content The last update: 12/12/2008

How to learn, on what family операционок (NT or 9x), my program is launched?

The author: OlegGG, trainer
The initial link: - - -

  1. To use function WinAPI GetVersion or GetVersionEx. The following function returns true if the program is launched on NT:
    bool isNT () 
    { 
    OSVERSIONINFO ver_info; 
    ver_info.dwOSVersionInfoSize = sizeof (OSVERSIONINFO); 
    GetVersionEx (&ver_info); 
    return (ver_info.dwPlatformId == VER_PLATFORM_WIN32_NT); 
    }
    

  2. To check up value of global variable Win32Platform. Possible variants of values:
    • VER_PLATFORM_WIN32_NT - The program is fulfilled under control of OS of line WinNT (Windows NT/2000/XP)
    • VER_PLATFORM_WIN32_WINDOWS - The program is fulfilled under control of OS of line Win9x (Windows 95/98/Me)
    • VER_PLATFORM_WIN32s - The program is fulfilled under control of OS Windows 3.1 with installed Win32s extension