home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form frmVers
- Caption = "DOS and Windows Version Information"
- ClientHeight = 3420
- ClientLeft = 2730
- ClientTop = 1485
- ClientWidth = 5730
- Height = 3825
- Left = 2670
- LinkTopic = "Form1"
- ScaleHeight = 3420
- ScaleWidth = 5730
- Top = 1140
- Width = 5850
- Begin Label lblDosVer
- ForeColor = &H00FF0000&
- Height = 195
- Left = 2850
- TabIndex = 3
- Top = 825
- Width = 885
- End
- Begin Label Windows
- AutoSize = -1 'True
- Caption = "Your Windows Version is:"
- Height = 195
- Left = 600
- TabIndex = 2
- Top = 1800
- Width = 2175
- End
- Begin Label MSDOS
- Caption = "Your MS-DOS Version is:"
- Height = 195
- Left = 630
- TabIndex = 1
- Top = 825
- Width = 2130
- End
- Begin Label lblWinVer
- ForeColor = &H00FF0000&
- Height = 210
- Left = 2865
- TabIndex = 0
- Top = 1800
- Width = 870
- End
- 'This API declaration retrieves Windows Version Information
- Declare Function GetFileVersionInfo% Lib "VER.DLL" (ByVal lpszFileName$, ByVal handle As Any, ByVal cbBuf&, ByVal lpvData$)
- 'This API declaration retrieves DOS Version Information
- Declare Function GetVersion Lib "Kernel" () As Long
- 'NOTE: You can also use the "GetVersion" API to retrieve
- 'Windows version information, but it is only partially
- 'accurate. For example, if you are running Windows v3.11
- 'it will still return v3.1 or if you are running Windows 95
- 'it will return v3.95 instead of 4.00
- Sub Form_Load ()
- 'Show Windows Version
- Dim Pos As Integer
- Dim Version As String
- Dim Ans As String
- Version = Space$(255)
- ret% = GetFileVersionInfo("user.exe", 0&, 254, Version)
- Pos = InStr(1, Version, "FileVersion")
- Ans = Mid$(Version, Pos + 12, 4)
- lblWinVer.Caption = Ans
- 'Shows DOS Version
- J& = GetVersion()
- DOS& = (J& And &HFFFF0000) / 65536
- Lowbyte$ = Str$(DOS& And &HFF)
- Highbyte$ = LTrim$(Str$((DOS& And &HFF00) / 256))
- lblDosVer.Caption = Highbyte$ + "." + Lowbyte$
- End Sub
-