Sep 24th, 2002, 01:26 PM
#1
Thread Starter
PowerPoster
Anyone Running on Win XP?
Is there somebody who is running on Win XP? I need to determine the OS version info through code. I already know how to extract the relevant information, but I don't have access to XP machine, so if somebody could run my code on XP and return me the data needed, it would be great.
The code is in a class module, and you just need to call the GetPlatform function of the class. The output of the function is what I want.
Thanks
Amitabh
Sep 24th, 2002, 01:55 PM
#2
I have XP... where is the class ?
Sep 24th, 2002, 02:06 PM
#3
-= B u g S l a y e r =-
VB Code:
Public Declare Function GetVersionExA Lib "kernel32" _
(lpVersionInformation As OSVERSIONINFO) As Integer
Public Type OSVERSIONINFO
dwOSVersionInfoSize As Long
dwMajorVersion As Long
dwMinorVersion As Long
dwBuildNumber As Long
dwPlatformId As Long
szCSDVersion As String * 128
End Type
Public Function getVersion() As String
Dim osinfo As OSVERSIONINFO
Dim retvalue As Integer
osinfo.dwOSVersionInfoSize = 148
osinfo.szCSDVersion = Space$(128)
retvalue = GetVersionExA(osinfo)
With osinfo
Select Case .dwPlatformId
Case 1
Select Case .dwMinorVersion
Case 0
getVersion = "Windows 95"
Case 10
getVersion = "Windows 98"
Case 90
getVersion = "Windows Mellinnium"
End Select
Case 2
Select Case .dwMajorVersion
Case 3
getVersion = "Windows NT 3.51"
Case 4
getVersion = "Windows NT 4.0"
Case 5
If .dwMinorVersion = 0 Then
getVersion = "Windows 2000"
Else
getVersion = "Windows XP"
End If
End Select
Case Else
getVersion = "Failed"
End Select
End With
End Function
might be helpful
Sep 24th, 2002, 02:37 PM
#4
Thread Starter
PowerPoster
Attached Files
Sep 24th, 2002, 02:38 PM
#5
Thread Starter
PowerPoster
Peet
Which edition of XP are you running?
Sep 24th, 2002, 02:42 PM
#6
Windows XP Professional
Here's the output: "v5.1 (Build 2600)"
Nice Class... can I use it for myself ?
Sep 24th, 2002, 02:45 PM
#7
Thread Starter
PowerPoster
Definitely.
Thanks for your response.
BTW, here is full class code that is in the original. I trimmed it so that it was easy to ask questions.
Attached Files
Sep 24th, 2002, 02:48 PM
#8
Thread Starter
PowerPoster
Anyone else running on other editons of XP, 2000 Advanced server, DataCenter Server. Or anyplace I can find the relevant values.
Sep 24th, 2002, 02:52 PM
#9
-= B u g S l a y e r =-
Originally posted by amitabh
Peet
Which edition of XP are you running?
Version 5.1 (Build 2600.xpclnt_qfe.010827-1803) (whaterver that last part means beats me )
but the class return the same as CVMichael
Sep 24th, 2002, 03:01 PM
#10
Thread Starter
PowerPoster
Thanks. This will most probably work with all versions of XP.
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