How do you find out the Windows verson in VB6?

Posted on 2004-04-19
Last Modified: 2013-12-26
How do you find out the Windows verson in VB6?
Question by:gregmarby
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 43

Expert Comment

ID: 10857917
Hi gregmarby,

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

Tim Cottee
Brainbench MVP for Visual Basic
LVL 10

Assisted Solution

ADSaunders earned 65 total points
ID: 10857928
Hi gregmarby,

  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()
    VersInfo.dwOSVersionInfoSize = Len(VersInfo)
    Dim vno As Integer
    vno = GetVersionEx(VersInfo)
    G_WinVer = VersInfo.dwPlatformId
End Sub

.. Alan

Regards .. Alan
LVL 53

Expert Comment

ID: 10858101
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 10858132
I think I may have asked the question incorrectly. I want to know if it is Windows 98 or XP etc.
LVL 53

Expert Comment

ID: 10858141
With the links, function, ... etc that are already provided, you can see if you have windows 98, xp, ...
LVL 43

Accepted Solution

TimCottee earned 60 total points
ID: 10858146

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.


Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article ( for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question