Utilizamos cookies propias y de terceros para mejorar la experiencia de navegación, y ofrecer contenidos y publicidad de interés. Al continuar con la navegación entendemos que se acepta nuestra política de cookies.
'// Used to determine the operating system. Public Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA" (lpVersionInformation As OSVERSIONINFO) As Long
'// Operating System information. Public Type OSVERSIONINFO dwOSVersionInfoSize As Long dwMajorVersion As Long dwMinorVersion As Long dwBuildNumber As Long dwPlatformId As Long szCSDVersion As String * 128 End Type
Public Function GetOS() As String '// Determine the operating system of the target machine. Dim osvi As OSVERSIONINFO
osvi.dwOSVersionInfoSize = Len(osvi) GetVersionEx osvi Select Case osvi.dwPlatformId Case 2 '// VER_PLATFORM_WIN32_NT. Select Case osvi.dwMajorVersion Case 5 Select Case osvi.dwMinorVersion Case 0 GetOS = "Microsoft Windows 2000" Case 1 GetOS = "Microsoft Windows XP" Case 2 GetOS = "Microsoft Windows Server 2003 family" End Select Case Is <= 4 GetOS = "Microsoft Windows NT" End Select Case 1 '// VER_PLATFORM_WIN32_WINDOWS. If osvi.dwMajorVersion = 4 Then Select Case osvi.dwMinorVersion Case 0 GetOS = "Microsoft Windows 95" Case 10 GetOS = "Microsoft Windows 98" Case 90 GetOS = "Microsoft Windows Millennium Edition" End Select End If Case 0 '// VER_PLATFORM_WIN32s. GetOS = "Microsoft Win32s" End Select End Function