home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form Main
- BackColor = &H00808080&
- Caption = "System Info DLL Demo"
- DrawStyle = 1 'Transparent
- Height = 4665
- Icon = 0
- KeyPreview = -1 'True
- Left = 1035
- LinkTopic = "Form1"
- ScaleHeight = 4260
- ScaleWidth = 7365
- Top = 1140
- Width = 7485
- Begin Frame Frame1
- BackColor = &H00C0C0C0&
- Caption = "About..."
- Height = 3375
- Left = 240
- TabIndex = 5
- Top = 360
- Width = 5175
- Begin Label Label12
- BackColor = &H00C0C0C0&
- Height = 255
- Left = 120
- TabIndex = 17
- Top = 3000
- Width = 4935
- End
- Begin Label Label11
- BackColor = &H00C0C0C0&
- Height = 255
- Left = 120
- TabIndex = 16
- Top = 2760
- Width = 4935
- End
- Begin Label Label10
- BackColor = &H00C0C0C0&
- Height = 255
- Left = 120
- TabIndex = 15
- Top = 2520
- Width = 4935
- End
- Begin Label Label9
- BackColor = &H00C0C0C0&
- Height = 255
- Left = 120
- TabIndex = 14
- Top = 2280
- Width = 4935
- End
- Begin Label Label8
- BackColor = &H00C0C0C0&
- Height = 255
- Left = 120
- TabIndex = 13
- Top = 2040
- Width = 4935
- End
- Begin Label Label7
- BackColor = &H00C0C0C0&
- Height = 255
- Left = 120
- TabIndex = 12
- Top = 1800
- Width = 4935
- End
- Begin Label Label6
- BackColor = &H00C0C0C0&
- Height = 255
- Left = 120
- TabIndex = 11
- Top = 1560
- Width = 4935
- End
- Begin Label Label5
- BackColor = &H00C0C0C0&
- Height = 255
- Left = 120
- TabIndex = 10
- Top = 1320
- Width = 4935
- End
- Begin Label Label4
- BackColor = &H00C0C0C0&
- Height = 255
- Left = 120
- TabIndex = 9
- Top = 1080
- Width = 4935
- End
- Begin Label Label3
- BackColor = &H00C0C0C0&
- Height = 255
- Left = 120
- TabIndex = 8
- Top = 840
- Width = 4935
- End
- Begin Label Label2
- BackColor = &H00C0C0C0&
- Height = 255
- Left = 120
- TabIndex = 7
- Top = 600
- Width = 4935
- End
- Begin Label Label1
- BackColor = &H00C0C0C0&
- Height = 255
- Left = 120
- TabIndex = 6
- Top = 360
- Width = 4935
- End
- End
- Begin CommandButton Network
- Caption = "Network"
- Height = 495
- Left = 5760
- TabIndex = 4
- Top = 3000
- Width = 1095
- End
- Begin CommandButton Windows
- Caption = "Windows"
- Height = 495
- Left = 5760
- TabIndex = 3
- Top = 2400
- Width = 1095
- End
- Begin CommandButton Drives
- Caption = "Drives"
- Height = 495
- Left = 5760
- TabIndex = 2
- Top = 1800
- Width = 1095
- End
- Begin CommandButton Video
- Caption = "Video"
- Height = 495
- Left = 5760
- TabIndex = 1
- Top = 1200
- Width = 1095
- End
- Begin CommandButton CPU
- Caption = "CPU"
- Height = 495
- Left = 5760
- TabIndex = 0
- Top = 600
- Width = 1095
- End
- Sub ClrWin ()
- Label1.Caption = ""
- Label2.Caption = ""
- Label3.Caption = ""
- Label4.Caption = ""
- Label5.Caption = ""
- Label6.Caption = ""
- Label7.Caption = ""
- Label8.Caption = ""
- Label9.Caption = ""
- Label10.Caption = ""
- Label11.Caption = ""
- Label12.Caption = ""
- End Sub
- Sub CPU_Click ()
- Dim WinFlags As Long
- Dim Avail As Long, FreeSpace As Long
- Dim Major As Integer, Minor As Integer, Mouse As Integer, IRQ As Integer
- Dim Model As Integer, Submodel As Integer, Rev As Integer
- Dim M As String, S As String, R As String
- Call ClrWin
- Frame1.Caption = "CPU Info..."
- WinFlags = GetWinFlags()
- 'get model I.D.
- Call GetID(Model, Submodel, Rev)
- 'display model type
- Label1.Caption = "Model Type: "
- Select Case Model
- Case &HFF
- Label1.Caption = Label1.Caption & "IBM PC or compatible"
- Case &HFE
- Label1.Caption = Label1.Caption & "IBM PC/XT or compatible"
- Case &HFC
- Select Case Submodel
- Case &H2
- Label1.Caption = Label1.Caption & "IBM XT-286"
- Case &H4, &H5, &H9
- Label1.Caption = Label1.Caption & "PS/2"
- Case &HB
- Label1.Caption = Label1.Caption & "PS/1"
- Case Else
- Label1.Caption = Label1.Caption & "IBM AT or compatible"
- End Select
- Case &HFB
- Label1.Caption = Label1.Caption & "IBM PC/XT or compatible"
- Case &HFA
- Label1.Caption = Label1.Caption & "PS/1"
- Case &HF9
- Label1.Caption = Label1.Caption & "PC Convertible"
- Case &HF8
- Select Case Submodel
- Case &HE, &HF, &H30
- Label1.Caption = Label1.Caption & "PS/1"
- Case &H1F, &H49, &H4A, &H4B
- Label1.Caption = Label1.Caption & "PS/ValuePoint"
- Case &H5E
- Label1.Caption = Label1.Caption & "IBM Thinkpad"
- Case Else
- Label1.Caption = Label1.Caption & "PS/2"
- End Select
- Case &HE1
- Label1.Caption = Label1.Caption & "PS/2"
- Case Else
- Label1.Caption = Label1.Caption & "Unknown model"
- End Select
- 'display I.D. bytes
- M = Hex$(Model)
- S = Hex$(Submode)
- R = Hex$(Rev)
- If Len(M) < 2 Then M = "0" & M
- If Len(S) < 2 Then S = "0" & S
- If Len(R) < 2 Then R = "0" & R
- Label2.Caption = "Model I.D. Bytes: " & M & " " & S & " " & R
- 'display CPU type
- Label4.Caption = "CPU Type: "
- If WinFlags And WF_CPU086 Then
- Label4.Caption = Label4.Caption & "8086"
- ElseIf WinFlags And WF_CPU186 Then
- Label4.Caption = Label4.Caption & "80186"
- ElseIf WinFlags And WF_CPU286 Then
- Label4.Caption = Label4.Caption & "80286"
- ElseIf WinFlags And WF_CPU386 Then
- Label4.Caption = Label4.Caption & "80386"
- ElseIf WinFlags And WF_CPU486 Then
- Label4.Caption = Label4.Caption & "80486"
- Else
- Label4.Caption = Label4.Caption & "Unknown"
- End If
- If WinFlags And WF_80x87 Then Label4.Caption = Label4.Caption & " (Math coprocessor present)"
- 'get number of serial and parallel ports
- Label6.Caption = "Serial Ports : " & Str$(GetSerial())
- Label7.Caption = "Parallel Ports : " & Str$(GetParallel())
- 'get available memory
- Avail = GetFreeSpace(0)
- If Sgn(Avail) = -1 Then
- FreeSpace = CLng(Avail + 1&) Xor &HFFFFFFFF
- Else
- FreeSpace = Avail
- End If
- Label9.Caption = "Available Memory: " & Str$(FreeSpace) & " bytes"
- 'get mouse info
- If GetMouseInfo(Major, Minor, Mouse, IRQ) Then
- Label11.Caption = "Mouse Driver Version " & Str$(Major) & "." & Str$(Minor)
- Label12.Caption = "Mouse Type: "
- Select Case Mouse
- Case 1:
- Label12.Caption = Label12.Caption & "Bus Mouse" & " (Using IRQ " & Str$(IRQ) & ")"
- Case 2:
- Label12.Caption = Label12.Caption & "Serial Mouse" & " (Using IRQ " & Str$(IRQ) & ")"
- Case 3:
- Label12.Caption = Label12.Caption & "Inport Mouse" & " (Using IRQ " & Str$(IRQ) & ")"
- Case 4:
- Label12.Caption = Label12.Caption & "PS/2 Mouse"
- Case 5:
- Label12.Caption = Label12.Caption & "Hewlett-Packard Mouse" & " (Using IRQ " & Str$(IRQ) & ")"
- End Select
- Else
- Label11.Caption = "Mouse Driver Not Installed."
- End If
- End Sub
- Sub Drives_Click ()
- Dim ClusSize As Long, Avail As Long
- Dim a As Integer, b As Integer
- Dim Major As Integer, Minor As Integer
- Dim Drive As String
- Call ClrWin
- Frame1.Caption = "Drive Info..."
- 'check for SmartDrive
- If ChkSmartDrv() Then
- Label1.Caption = "SmartDrive installed"
- Else
- Label1.Caption = "SmartDrive not installed"
- End If
- 'check for DblSpace
- If ChkDblSpace() Then
- Label2.Caption = "DblSpace installed"
- Else
- Label2.Caption = "DblSpace not installed"
- End If
- 'check for MSCDEX CD-ROM extension
- If GetMSCDEX(Major, Minor) Then
- Label3.Caption = "MSCDEX installed (Version " & Str$(Major) & "." & Str$(Minor) & ")"
- Else
- Label3.Caption = "MSCDEX not installed"
- End If
- 'get floppy drive info
- If Not GetFloppyDrvs(a, b) Then
- Select Case a
- Case 0:
- Label5.Caption = "Drive A: Not installed"
- Case 1:
- Label5.Caption = "Drive A: 360K DD"
- Case 2:
- Label5.Caption = "Drive A: 1.2M HD"
- Case 3:
- Label5.Caption = "Drive A: 720K DD"
- Case 4:
- Label5.Caption = "Drive A: 1.44M HD"
- Case 5:
- Label5.Caption = "Drive A: 2.88M ED"
- Case Else
- Label5.Caption = "Drive A: Unknown"
- End Select
- Select Case b
- Case 0:
- Label6.Caption = "Drive B: Not installed"
- Case 1:
- Label6.Caption = "Drive B: 360K DD"
- Case 2:
- Label6.Caption = "Drive B: 1.2M HD"
- Case 3:
- Label6.Caption = "Drive B: 720K DD"
- Case 4:
- Label6.Caption = "Drive B: 1.44M HD"
- Case 5:
- Label6.Caption = "Drive B: 2.88M ED"
- Case Else
- Label6.Caption = "Drive B: Unknown"
- End Select
- End If
- 'display current drive info
- If Not GetDrvSpace(0, SecPerClus&, FreeClus&, BytesPerSec&, TotalClus&) Then
- ClusSize& = BytesPerSec& * SecPerClus&
- Free& = FreeClus& * ClusSize&
- Drive = Left$(CurDir$, 1)
- Label8.Caption = "Current Drive = " & Drive & ":"
- If IsDblSPace(Asc(Drive) - 65) Then
- Label8.Caption = Label8.Caption & " (DblSpace)"
- End If
- Label9.Caption = " Available Space: " & Free& & " bytes"
- End If
- 'get lastdrive
- Label11.Caption = "Lastdrive = " & Chr$(GetLastDrv() + 64)
- End Sub
- Sub Form_Load ()
- Label1.Caption = " System Info DLL Demo"
- Label2.Caption = " For Visual Basic "
- Label6.Caption = " Version 1.00 "
- Label10.Caption = " This Library is Copyrighted (C) 1994 By Paul Lapsansky"
- Label11.Caption = " ALL RIGHTS RESERVED"
- End Sub
- Sub Network_Click ()
- Dim Major As Integer, Minor As Integer, Rev As Integer, Mem As Integer
- Call ClrWin
- Frame1.Caption = "Network Info..."
- 'check for IPX
- If ChkIPX() Then
- Label1.Caption = "Novell IPX Installed"
- Else
- Label1.Caption = "Novell IPX Not Installed"
- End If
- If GetNetShellInfo(Major, Minor, Rev, Mem) Then
- Label3.Caption = "Novell NetShell Version " & Str$(Major) & "." & Str$(Minor) & "." & Str$(Rev) & " installed"
- Select Case Mem
- Case 1:
- Label4.Caption = " NetShell Loaded in EMS Memory"
- Case 2:
- Label4.Caption = " NetShell Loaded in XMS Memory"
- Case Else
- Label4.Caption = " NetShell Loaded in Conventional Memory"
- End Select
- Else
- Label3.Caption = "Novell NetShell Not Installed"
- End If
- End Sub
- Sub Video_Click ()
- Dim Card As Integer
- Call ClrWin
- Frame1.Caption = "Video Info..."
- 'get video card type
- Card = GetVidType()
- Label1.Caption = "Video Adapter: "
- Select Case Card
- Case 1:
- Label1.Caption = Label1.Caption & "Hercules Monochrome Graphics"
- Case 2:
- Label1.Caption = Label1.Caption & "CGA - Color Graphics Adapter"
- Case 3:
- Label1.Caption = Label1.Caption & "EGA - Enhanced Graphics Adapter"
- If GetCrtType() Then
- Label1.Caption = Label1.Caption & " (Monochrome)"
- Else
- Label1.Caption = Label1.Caption & " (Color)"
- End If
- Case 4:
- Label1.Caption = Label1.Caption & "VGA - Video Graphics Array"
- If GetCrtType() Then
- Label1.Caption = Label1.Caption & " (Monochrome)"
- Else
- Label1.Caption = Label1.Caption & " (Color)"
- End If
- End Select
- 'get video driver info
- Label3.Caption = "Video Driver: " & GetSysIni("boot.description", "display.drv")
- Label4.Caption = "Resolution: " & Screen.Width \ Screen.TwipsPerPixelX & " x " & Screen.Height \ Screen.TwipsPerPixelY
- Label5.Caption = "Colors: " & DeviceColors((hDC))
- End Sub
- Sub Windows_Click ()
- Dim WinFlags As Long, Major As Integer, Minor As Integer, OEM As Integer
- Dim DR As Integer
- Dim temp As String
- Call ClrWin
- Frame1.Caption = "Windows Info..."
- 'get Windows info
- WinFlags = GetWinFlags()
- Label1.Caption = "Microsoft Windows Version " & WindowsVersion()
- If WinFlags And WF_ENHANCED Then
- Label1.Caption = Label1.Caption & " (Enhanced Mode)"
- ElseIf WinFlags And WF_STANDARD Then
- Label1.Caption = Label1.Caption & " (Standard Mode)"
- Else
- Label1.Caption = Label1.Caption & " (Real Mode)"
- End If
- 'get DOS version
- Call GetDosVer(Major, Minor)
- Label3.Caption = "DOS Version " & Str$(Major) & "." & Str$(Minor)
- 'check for DR-DOS
- DR = GetDrDosVer()
- Select Case DR
- Case &H1:
- Label3.Caption = Label3.Caption & " (Multi-User DR-DOS)"
- Case &H60:
- Label3.Caption = Label3.Caption & " (DOS Plus)"
- Case &H63:
- Label3.Caption = Label3.Caption & " (DR-DOS 3.41)"
- Case &H64:
- Label3.Caption = Label3.Caption & " (DR-DOS 3.42)"
- Case &H65:
- Label3.Caption = Label3.Caption & " (DR-DOS 5.0)"
- Case &H67:
- Label3.Caption = Label3.Caption & " (DR-DOS 6.0)"
- Case &H70:
- Label3.Caption = Label3.Caption & " (PalmDOS)"
- Case &H71:
- Label3.Caption = Label3.Caption & " (DR-DOS 6.0 March 1993 Update)"
- Case &H72:
- Label3.Caption = Label3.Caption & " (Novell DOS 7.0)"
- End Select
- 'get DOS OEM number and check for PC-DOS 6.1
- OEM = GetDosOem()
- If Major = 6 And Minor = 0 And OEM = 0 Then
- Label3.Caption = Label3.Caption & " (PC-DOS 6.1)"
- End If
- temp = Hex$(OEM)
- If Len(temp) < 2 Then
- temp = "0" & temp & "h"
- Else
- temp = temp & "h"
- End If
- Label4.Caption = "OEM Identification: " & temp
- Select Case OEM
- Case &H0:
- Label4.Caption = Label4.Caption & " (PC-DOS)"
- Case &H1:
- Label4.Caption = Label4.Caption & " (Compaq DOS)"
- Case &H4:
- Label4.Caption = Label4.Caption & " (AT&T DOS)"
- Case &H5:
- Label4.Caption = Label4.Caption & " (Zenith DOS)"
- Case &H6, &H4D:
- Label4.Caption = Label4.Caption & " (Hewlett-Packard DOS)"
- Case &HD:
- Label4.Caption = Label4.Caption & " (Packard-Bell DOS)"
- Case &H16:
- Label4.Caption = Label4.Caption & " (DEC DOS)"
- Case &H23:
- Label4.Caption = Label4.Caption & " (Olivetti DOS)"
- Case &H29:
- Label4.Caption = Label4.Caption & " (Toshiba DOS)"
- Case Else
- Label4.Caption = Label4.Caption & " (MS-DOS)"
- End Select
- End Sub
-