Hi
In some quite mature code I make the following declaration and use the
following code. The program is VB6 running under Vista.Ultimate
It now returns 5 for the MajorVersion where as the system has been running
successfully for some time based on the assumption that 'Version 6" is
first release of Vista, and 'Version 5.1 Is XP SP2
Has Something changed
Roger Stenson
DECLARATION
Private Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA"
(lpVersionInformation As OSVERSIONINFO) As Long
Private Type OSVERSIONINFO
dwOSVersionInfoSize As Long
dwMajorVersion As Long
dwMinorVersion As Long
dwBuildNumber As Long
dwPlatformId As Long
szCSDVersion As String * 128
End Type
CODE
'Get the Windows version
Dim OSVersion As String
Dim OSInfo As OSVERSIONINFO, PId As String
OSInfo.dwOSVersionInfoSize = Len(OSInfo)
Ret& = GetVersionEx(OSInfo)
OSVersion = Trim(Str$(OSInfo.dwMajorVersion))
If OSVersion = "6" Then
.......
Else
...
End If
mayayana - 23 Oct 2007 12:51 GMT
There was a discussion about that awhile
back. More fun with Vista's "features". :)
See here for the whole thread:
http://groups.google.com/group/microsoft.public.vb.general.discussion/browse
_thread/thread/9e079e5d0fe42cbf/bf9e5fdc7fb8fbea#bf9e5fdc7fb8fbea
> In some quite mature code I make the following declaration and use the
> following code. The program is VB6 running under Vista.Ultimate
[quoted text clipped - 31 lines]
> ...
> End If