'***************************************************************************
'* Copyright (C) 2007 by Veronese Alberto *
'*
'* *
'* This program is free software; you can redistribute it and/or modify *
'* it under the terms of the GNU General Public License as published by *
'* the Free Software Foundation; either version 2 of the License, or *
'* (at your option) any later version. *
'* *
'* This program is distributed in the hope that it will be useful, *
'* but WITHOUT ANY WARRANTY; without even the implied warranty of *
'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
'* GNU General Public License for more details. *
'* *
'* You should have received a copy of the GNU General Public License *
'* along with this program; if not, write to the *
'* Free Software Foundation, Inc., *
'* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
'***************************************************************************
Private Type OSVERSIONINFO
dwOSVersionInfoSize As Long
dwMajorVersion As Long
dwMinorVersion As Long
dwBuildNumber As Long
dwPlatformId As Long
szCSDVersion As String * 128
End Type
Private Declare Function GetVersionEx Lib "kernel32.dll" Alias "GetVersionExA" (lpVersionInformation As OSVERSIONINFO) As Long
Private Sub cmdok_Click()
If cmdok.Caption = "Esci" Then
End
Else
cmdok.Caption = "Esci"
End If
Dim os As OSVERSIONINFO ' riceve la versione
Dim retval As Long ' valore di ritorno
os.dwOSVersionInfoSize = Len(os) ' Imposta la lunghezza della struttura
retval = GetVersionEx(os) ' legge le info sulla versione di Windows
Txtp.Text = os.dwPlatformId
Txtmv.Text = os.dwMajorVersion
Txtminv.Text = os.dwMinorVersion
Txtbn.Text = os.dwBuildNumber
Txtei.Text = os.szCSDVersion
End Sub