|
-
Dec 18th, 2000, 02:09 AM
#1
Thread Starter
PowerPoster
What is the constant used in case the operating system is Windows Me? I am using GetVersionEx API call with OSVERSIONINFO data structure.
Amitabh
-
Dec 18th, 2000, 03:29 PM
#2
Windows 3.x = 0
Windows 95/98/ME = 1
Windows NT = 2
-
Dec 19th, 2000, 12:30 AM
#3
Thread Starter
PowerPoster
What about Windows 2000? Same as NT! Also, how do I differentiate between 95/98/Me?
-
Dec 19th, 2000, 03:28 PM
#4
Yes, 2000 is the same as NT. I'm not sure if you can differenciate between group into the specific OS.
-
Dec 20th, 2000, 12:24 AM
#5
Thread Starter
PowerPoster
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.
-
Dec 21st, 2000, 11:50 AM
#6
Hyperactive Member
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
-
Dec 21st, 2000, 03:47 PM
#7
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
-
Dec 22nd, 2000, 05:38 AM
#8
Thread Starter
PowerPoster
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|