Option Explicit
Private Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA" (lpVersionInformation As OVSERSIONINFOEX) As Long
Private Type OVSERSIONINFOEX
dwOVSersionInfoSize As Long
dwMajorVersion As Long
dwMinorVersion As Long
dwBuildNumber As Long
dwPlatformId As Long
szCSDVersion As String * 128
wServicePackMajor As Integer
wServicePackMinor As Integer
wSuiteMask As Integer
wProductType As Byte
wReserved As Byte
End Type
Public Function IsVistaSystem() As Boolean Dim OVS As OVSERSIONINFOEX OVS.dwOVSersionInfoSize = Len(OVS) If GetVersionEx(OVS) = 1 Then If OVS.dwPlatformId = 2 And OVS.dwMajorVersion >= 6 And OVS.dwMinorVersion >= 0 Then IsVistaSystem = True End If End IfEnd Function
原文链接:https://www.f2er.com/vb/262413.html