Results 1 to 10 of 10

Thread: Anyone Running on Win XP?

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Aug 2000
    Location
    India
    Posts
    2,288

    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

  2. #2
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,803
    I have XP... where is the class ?

  3. #3
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    VB Code:
    1. Public Declare Function GetVersionExA Lib "kernel32" _
    2.                (lpVersionInformation As OSVERSIONINFO) As Integer
    3.  
    4.             Public Type OSVERSIONINFO
    5.                dwOSVersionInfoSize As Long
    6.                dwMajorVersion As Long
    7.                dwMinorVersion As Long
    8.                dwBuildNumber As Long
    9.                dwPlatformId As Long
    10.                szCSDVersion As String * 128
    11.             End Type
    12.  
    13.             Public Function getVersion() As String
    14.                Dim osinfo As OSVERSIONINFO
    15.                Dim retvalue As Integer
    16.  
    17.                osinfo.dwOSVersionInfoSize = 148
    18.                osinfo.szCSDVersion = Space$(128)
    19.                retvalue = GetVersionExA(osinfo)
    20.  
    21.                With osinfo
    22.                Select Case .dwPlatformId
    23.  
    24.                 Case 1
    25.                
    26.                     Select Case .dwMinorVersion
    27.                         Case 0
    28.                             getVersion = "Windows 95"
    29.                         Case 10
    30.                             getVersion = "Windows 98"
    31.                         Case 90
    32.                             getVersion = "Windows Mellinnium"
    33.                     End Select
    34.    
    35.                 Case 2
    36.                     Select Case .dwMajorVersion
    37.                         Case 3
    38.                             getVersion = "Windows NT 3.51"
    39.                         Case 4
    40.                             getVersion = "Windows NT 4.0"
    41.                         Case 5
    42.                             If .dwMinorVersion = 0 Then
    43.                                 getVersion = "Windows 2000"
    44.                             Else
    45.                                 getVersion = "Windows XP"
    46.                             End If
    47.                     End Select
    48.    
    49.                 Case Else
    50.                    getVersion = "Failed"
    51.             End Select
    52.  
    53.                End With
    54.             End Function

    might be helpful
    -= a peet post =-

  4. #4

    Thread Starter
    PowerPoster
    Join Date
    Aug 2000
    Location
    India
    Posts
    2,288
    Sorry here it is:
    Attached Files Attached Files

  5. #5

    Thread Starter
    PowerPoster
    Join Date
    Aug 2000
    Location
    India
    Posts
    2,288
    Peet
    Which edition of XP are you running?

  6. #6
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,803
    Windows XP Professional

    Here's the output: "v5.1 (Build 2600)"

    Nice Class... can I use it for myself ?

  7. #7

    Thread Starter
    PowerPoster
    Join Date
    Aug 2000
    Location
    India
    Posts
    2,288
    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 Attached Files

  8. #8

    Thread Starter
    PowerPoster
    Join Date
    Aug 2000
    Location
    India
    Posts
    2,288
    Anyone else running on other editons of XP, 2000 Advanced server, DataCenter Server. Or anyplace I can find the relevant values.

  9. #9
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    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
    -= a peet post =-

  10. #10

    Thread Starter
    PowerPoster
    Join Date
    Aug 2000
    Location
    India
    Posts
    2,288
    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
  •  



Click Here to Expand Forum to Full Width