CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Win95,98 or NT?

  1. #1
    Join Date
    Apr 1999
    Location
    Philippines
    Posts
    46

    Win95,98 or NT?

    Good Day!
    How will I programmatically determine the platform (Win95,98 or NT)
    where my app is currently running? Thanks in advance.


  2. #2
    Join Date
    Apr 1999
    Location
    Germany
    Posts
    418

    Re: Win95,98 or NT?

    Hi Tonio,

    you can use GetVersionEx to get the OS including version and build number.

    HTH

    Martin

  3. #3
    Join Date
    May 1999
    Posts
    40

    Re: Win95,98 or NT?

    OSVERSIONINFO osv;
    osv.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
    CString WindowsPlatform;
    if (GetVersionEx(&osv))
    {
    // note: szCSDVersion = service pack release
    CString ServiceRelease = osv.szCSDVersion;
    switch(osv.dwPlatformId)
    {
    case VER_PLATFORM_WIN32s: //Win32s on Windows 3.1.
    WindowsPlatform = "MicrosoftR Windows 3.1(TM)";
    break;

    case VER_PLATFORM_WIN32_WINDOWS: //WIN32 on 95 or 98
    //determine if Win95 or Win98
    if (osv.dwMinorVersion == 0)
    {
    WindowsPlatform = "MicrosoftR Windows 95(TM) " + ServiceRelease;
    }
    else
    {
    WindowsPlatform = "MicrosoftR Windows 98(TM) " + ServiceRelease;
    }
    break;

    case VER_PLATFORM_WIN32_NT: //Win32 on Windows NT.
    WindowsPlatform = "MicrosoftR Windows NT(TM) " + ServiceRelease;
    break;

    default:
    AfxMessageBox("Failed to get correct Operating System.", MB_OK);
    } //end switch
    } //end if


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured