Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / Win API / October 2007



Tip: Looking for answers? Try searching our database.

Detecting the Operatiing System  Fails ?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Roger Stenson - 23 Oct 2007 08:24 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.