home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 32 / IOPROG_32.ISO / COMMON / RTFAPI.ZIP / Api_VB / frmVbApi.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1998-04-24  |  3.5 KB  |  93 lines

  1. VERSION 5.00
  2. Begin VB.Form frmVbApi 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "Le API di VB by Francesco Mannarino"
  5.    ClientHeight    =   4980
  6.    ClientLeft      =   1875
  7.    ClientTop       =   1530
  8.    ClientWidth     =   5925
  9.    LinkTopic       =   "Form1"
  10.    MaxButton       =   0   'False
  11.    MinButton       =   0   'False
  12.    ScaleHeight     =   4980
  13.    ScaleWidth      =   5925
  14.    Begin VB.Label Label1 
  15.       Alignment       =   2  'Center
  16.       BackColor       =   &H00FFFFC0&
  17.       BorderStyle     =   1  'Fixed Single
  18.       Caption         =   "Cliccami e avrai le informazioni richieste"
  19.       ForeColor       =   &H00000080&
  20.       Height          =   855
  21.       Left            =   4800
  22.       TabIndex        =   0
  23.       Top             =   0
  24.       Width           =   975
  25.    End
  26. Attribute VB_Name = "frmVbApi"
  27. Attribute VB_GlobalNameSpace = False
  28. Attribute VB_Creatable = False
  29. Attribute VB_PredeclaredId = True
  30. Attribute VB_Exposed = False
  31. Option Explicit
  32. '    Questo 
  33.  un file dimostrativo sull'uso delle API in VB
  34.  stato creato per la rivista ioProgrammo della DiemmeEditori
  35. '    dal  Prof. Francesco Mannarino - Italy
  36. '                         il 19 Aprile 1998
  37. Dim HDRisult As Long
  38.   ' Variabile che determina il risultato della chiamata API
  39. Private Sub Form_Click()
  40.     frmInfo.Show 1
  41. End Sub
  42. Private Sub Label1_Click()
  43.       frmVbApi.Cls   ' pulisce il form
  44.      
  45.        ' chiamata a GetVolumeInformation(...)
  46.        HDRisult = InfoHD("c:\")
  47.      Print "HDRisult (1=OK / 0=fail)"; Tab(50); HDRisult
  48.      Print "nome Drive    "; Tab(50); "c:\"
  49.      Print "nome Volume   "; Tab(50); NomeVolume
  50.      Print "Nr Seriale    "; Tab(50); NrSeriale
  51.      Print "Max Componenti"; Tab(50); MaxComp
  52.      Print "FlSysFlag     "; Tab(50); FlSysFlag
  53.      Print "FlSysNamS     "; Tab(50); FlSysNamS
  54.      Print String$(100, Asc("-")) ' stampa linee
  55.        
  56.        ' chiamata a GetDiskFreeSpace(...)
  57.        InfoFisHd ("c:\")
  58.      Print "SettoriPerCluster"; Tab(50); SettoriPerCluster
  59.      Print "BytesPerSettori  "; Tab(50); BytesPerSettori
  60.      Print "NrClusterLiberi  "; Tab(50); NrClusterLiberi
  61.      Print "TotNrCluster     "; Tab(50); TotNrCluster
  62.      Print "Capienzahd       "; Tab(50); Capienzahd
  63.      Print String$(100, Asc("-")) ' stampa linee
  64.      
  65.        ' chiamata a GetSystemInfo(...)
  66.        Const TpPrc = "Tipo Processore"
  67.        GetSystemInfo MySystemInfo
  68.      Print "Tipo  processore usato"; Tab(50); MySystemInfo.dwOemID
  69.      Print "Grandezza pagina usata"; Tab(50); MySystemInfo.dwPageSize
  70.      Print "Indirizzo pi
  71.  basso per un'applicazione"; Tab(50); _
  72.         MySystemInfo.lpMinimumApplicationAddress
  73.      Print "Indirizzo pi
  74.  alto per un'applicazione"; Tab(50); _
  75.         MySystemInfo.lpMaximumApplicationAddress
  76.      Print "numero di processori configurati nel sistema "; Tab(50); _
  77.         MySystemInfo.dwActiveProcessorMask
  78.      Print "numero di processori nel sistema "; Tab(50); _
  79.         MySystemInfo.dwNumberOrfProcessors
  80.         Select Case MySystemInfo.dwProcessorType
  81.             Case PROCESSOR_INTEL_386
  82.               Print TpPrc; Tab(50); "Intel 386"
  83.             Case PROCESSOR_INTEL_486
  84.               Print TpPrc; Tab(50); "Intel 486"
  85.             Case PROCESSOR_INTEL_PENTIUM
  86.               Print TpPrc; Tab(50); "Intel Pentium"
  87.             Case PROCESSOR_MIPS_R4000
  88.               Print TpPrc; Tab(50); "MIPS R4000"
  89.             Case PROCESSOR_ALPHA_21064
  90.               Print TpPrc; Tab(50); "Alpha 21064"
  91.         End Select
  92. End Sub
  93.