Results 1 to 8 of 8

Thread: Windows Me Version?

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Aug 2000
    Location
    India
    Posts
    2,288
    What is the constant used in case the operating system is Windows Me? I am using GetVersionEx API call with OSVERSIONINFO data structure.

    Amitabh

  2. #2
    Guest
    Windows 3.x = 0
    Windows 95/98/ME = 1
    Windows NT = 2

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Aug 2000
    Location
    India
    Posts
    2,288
    What about Windows 2000? Same as NT! Also, how do I differentiate between 95/98/Me?

  4. #4
    Guest
    Yes, 2000 is the same as NT. I'm not sure if you can differenciate between group into the specific OS.

  5. #5

    Thread Starter
    PowerPoster
    Join Date
    Aug 2000
    Location
    India
    Posts
    2,288
    Is there any way we can get the major and minor build numbers of the operating system in Win98/95? If it is possible, then we can possibly parse and check the value against a database. Win2000 supports a API called VerifyVersionInfo which seems to able to provide all the build numbers,version and service pack installed.

  6. #6
    Hyperactive Member noble's Avatar
    Join Date
    Nov 2000
    Location
    Philly
    Posts
    471
    You can differentiate between different versions of windows
    by querying the registry.

    for 95/98/ME
    HKLM\Software\Windows\CurrentVersion ProductName =

    for NT/2k
    HKLM\Software\Windows NT\CurrentVersion ProductName =
    Bababooey
    Tatatoothy
    Mamamonkey

  7. #7
    Guest
    Add this to a Form with a CommandButton.
    Code:
    Private Declare Function GetVersionEx Lib "kernel32.dll" Alias "GetVersionExA" (lpVersionInformation As OSVERSIONINFO) As Long
    Private Declare Function GetDiskFreeSpaceEx Lib "kernel32.dll" Alias "GetDiskFreeSpaceExA" (ByVal lpDirectoryName As String, lpFreeBytesAvailableToCaller As ULARGE_INTEGER, lpTotalNumberOfBytes As ULARGE_INTEGER, lpTotalNumberOfFreeBytes As ULARGE_INTEGER) As Long
    Private Declare Sub CopyMemory Lib "kernel32.dll" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)
    
    Private Type ULARGE_INTEGER
      LowPart As Long
      HighPart As Long
    End Type
    
    Private Type OSVERSIONINFO
      dwOSVersionInfoSize As Long
      dwMajorVersion As Long
      dwMinorVersion As Long
      dwBuildNumber As Long
      dwPlatformId As Long
      szCSDVersion As String * 128
    End Type
    
    Dim OsInfo As OSVERSIONINFO
    Dim tmp As String
    Dim FreeUser As ULARGE_INTEGER
    Dim Total As ULARGE_INTEGER
    Dim FreeSys As ULARGE_INTEGER
    Dim Temp As Currency
    Dim fTemp As Currency
    
    Private Sub Command1_Click()
    
        'Get OS Info
        OsInfo.dwOSVersionInfoSize = Len(OsInfo)
        retval = GetVersionEx(OsInfo)
        
        Select Case OsInfo.dwPlatformId
            Case 0
                tmp = "Windows 3.x"
            Case 1
                tmp = "Windows 95/98"
            Case 2
                tmp = "Windows NT"
        End Select
        
        Print "Version: " & OsInfo.dwMajorVersion & "." & OsInfo.dwMinorVersion
        Print "Build: " & OsInfo.dwBuildNumber
        Print "Platform: " & tmp
      
        'Get DiskSpace
        GetDiskFreeSpaceEx "C:\", FreeUser, Total, FreeSys
        CopyMemory Temp, Total, 8
        CopyMemory fTemp, FreeUser, 8
        Print "Total Space: " & (CCur(Temp) * 10000) / 1000000000 & " GB"
        Print "Free Space: " & (CCur(fTemp) * 10000) / 1000000000 & " GB"
    End Sub

  8. #8

    Thread Starter
    PowerPoster
    Join Date
    Aug 2000
    Location
    India
    Posts
    2,288
    Is Windows Me same as Win95/98. Also what is the Minor Number that I will get in case of Win Me?

    Thanks for the help.

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