Vista Or Not ?

G

Guest

I want a means to determine whether the perating system is Vista or not, upon
startup of an application. It does not need to check for all possible
permutations of Windows operating systems - just Vista or not.

The problem, however, with using the typical GetVersionEx API is
compatibility mode - which I have never gotten to work for any application,
but I digress.... The OS checker function has to be reliable.

Some possible approaches ?
registry values at HKLM\Software\Microsoft\Windows NT\CurrentVersion
check for existence of a Vista-only system file in WINDOWS\SYSTEM32
check the version of Notepad.exe
check the version of the VBA reference

Since I have no clue how to check any of these, what do you make of the
problem ?

Thank you.
BrerGoose
 
D

Douglas J. Steele

Take a look at http://www.mvps.org/access/api/api0055.htm at "The Access
Web"

You'll need to add:

If .dwPlatformId = VER_PLATFORM_WIN32_NT And _
.dwMajorVersion = 6 And _
.dwMinorVersion = 0 Then
strOut = "Windows Vista (Version " & _
.dwMajorVersion & "." & .dwMinorVersion & _
") Build " & .dwBuildNumber
If (Len(.szCSDVersion)) Then
strOut = strOut & " (" & _
fTrimNull(.szCSDVersion) & ")"
End If
End If
 
G

Guest

As previously mentioned, the GetVersionEx API is unreliable due to
compatibility mode. Need a means that does not involve GetVersionEx, since
that returns the fake operating system data.

Thank you.
BrerGoose
 
D

Douglas J. Steele

I've not heard of problems with that code. Perhaps you can give more details
about the error you've encountered.
 
G

Guest

Go to any search engine and enter: GetVersionEx Compatibility

You will find various threads of discussion about how compatibility mode
returns the wrong operating system value.

Thank you.
BrerGoose
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top