home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form frmVbApi
- BorderStyle = 1 'Fixed Single
- Caption = "Le API di VB by Francesco Mannarino"
- ClientHeight = 4980
- ClientLeft = 1875
- ClientTop = 1530
- ClientWidth = 5925
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 4980
- ScaleWidth = 5925
- Begin VB.Label Label1
- Alignment = 2 'Center
- BackColor = &H00FFFFC0&
- BorderStyle = 1 'Fixed Single
- Caption = "Cliccami e avrai le informazioni richieste"
- ForeColor = &H00000080&
- Height = 855
- Left = 4800
- TabIndex = 0
- Top = 0
- Width = 975
- End
- Attribute VB_Name = "frmVbApi"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- ' Questo
- un file dimostrativo sull'uso delle API in VB
- stato creato per la rivista ioProgrammo della DiemmeEditori
- ' dal Prof. Francesco Mannarino - Italy
- ' il 19 Aprile 1998
- Dim HDRisult As Long
- ' Variabile che determina il risultato della chiamata API
- Private Sub Form_Click()
- frmInfo.Show 1
- End Sub
- Private Sub Label1_Click()
- frmVbApi.Cls ' pulisce il form
-
- ' chiamata a GetVolumeInformation(...)
- HDRisult = InfoHD("c:\")
- Print "HDRisult (1=OK / 0=fail)"; Tab(50); HDRisult
- Print "nome Drive "; Tab(50); "c:\"
- Print "nome Volume "; Tab(50); NomeVolume
- Print "Nr Seriale "; Tab(50); NrSeriale
- Print "Max Componenti"; Tab(50); MaxComp
- Print "FlSysFlag "; Tab(50); FlSysFlag
- Print "FlSysNamS "; Tab(50); FlSysNamS
- Print String$(100, Asc("-")) ' stampa linee
-
- ' chiamata a GetDiskFreeSpace(...)
- InfoFisHd ("c:\")
- Print "SettoriPerCluster"; Tab(50); SettoriPerCluster
- Print "BytesPerSettori "; Tab(50); BytesPerSettori
- Print "NrClusterLiberi "; Tab(50); NrClusterLiberi
- Print "TotNrCluster "; Tab(50); TotNrCluster
- Print "Capienzahd "; Tab(50); Capienzahd
- Print String$(100, Asc("-")) ' stampa linee
-
- ' chiamata a GetSystemInfo(...)
- Const TpPrc = "Tipo Processore"
- GetSystemInfo MySystemInfo
- Print "Tipo processore usato"; Tab(50); MySystemInfo.dwOemID
- Print "Grandezza pagina usata"; Tab(50); MySystemInfo.dwPageSize
- Print "Indirizzo pi
- basso per un'applicazione"; Tab(50); _
- MySystemInfo.lpMinimumApplicationAddress
- Print "Indirizzo pi
- alto per un'applicazione"; Tab(50); _
- MySystemInfo.lpMaximumApplicationAddress
- Print "numero di processori configurati nel sistema "; Tab(50); _
- MySystemInfo.dwActiveProcessorMask
- Print "numero di processori nel sistema "; Tab(50); _
- MySystemInfo.dwNumberOrfProcessors
- Select Case MySystemInfo.dwProcessorType
- Case PROCESSOR_INTEL_386
- Print TpPrc; Tab(50); "Intel 386"
- Case PROCESSOR_INTEL_486
- Print TpPrc; Tab(50); "Intel 486"
- Case PROCESSOR_INTEL_PENTIUM
- Print TpPrc; Tab(50); "Intel Pentium"
- Case PROCESSOR_MIPS_R4000
- Print TpPrc; Tab(50); "MIPS R4000"
- Case PROCESSOR_ALPHA_21064
- Print TpPrc; Tab(50); "Alpha 21064"
- End Select
- End Sub
-