How do you find out the Windows verson in VB6?

How do you find out the Windows verson in VB6?
gregmarbyAsked:
Who is Participating?
 
TimCotteeHead of Software ServicesCommented:
gregmarby,

The GetVersionEx api call, either from the link I gave you or dhaest's which is the same thing will allow you to work this out. Windows never reports the actual name of the version, simply a set of values which can then be used to determine the textual representation of that version.

You need to use the whole thing to do it, you cannot simply get a string representing the version without working it out from the internal version numbers.

Tim.
0
 
TimCotteeHead of Software ServicesCommented:
Hi gregmarby,

http://vbnet.mvps.org/code/helpers/iswinversion.htm

Is your best starting point for this. It includes a variety of handy methods.

Tim Cottee
Brainbench MVP for Visual Basic
http://www.brainbench.com
0
 
ADSaundersCommented:
Hi gregmarby,

Private Type OSVERSIONINFO
  dwOSVersionInfoSize As Long
  dwMajorVersion As Long
  dwMinorVersion As Long
  dwBuildNumber As Long
  dwPlatformId As Long
  szCSDVersion As String * 128
End Type

Private Declare Function GetVersionEx Lib "kernel32" _
                        Alias "GetVersionExA" _
                        (lpVersionInformation As OSVERSIONINFO) _
                         As Long
Private Sub p_GetWinVer()
    Dim VersInfo As OSVERSIONINFO
    VersInfo.dwOSVersionInfoSize = Len(VersInfo)
    Dim vno As Integer
    vno = GetVersionEx(VersInfo)
    G_WinVer = VersInfo.dwPlatformId
End Sub

.. Alan

Regards .. Alan
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
gregmarbyAuthor Commented:
I think I may have asked the question incorrectly. I want to know if it is Windows 98 or XP etc.
0
 
DhaestCommented:
With the links, function, ... etc that are already provided, you can see if you have windows 98, xp, ...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.