home *** CD-ROM | disk | FTP | other *** search
- Attribute VB_Name = "Modulo1"
- ' Questo Φ un file dimostrativo sull'uso delle API in VB
- ' Φ stato creato per la rivista ioProgrammo della DiemmeEditori
- ' dal Prof. Francesco Mannarino - Italy
- ' il 25 Aprile 1998
- Option Explicit
-
- Declare Function GetWindowsDirectory Lib _
- "kernel32" Alias "GetWindowsDirectoryA" _
- (ByVal lpBuffer As String, ByVal nSize As Long) _
- As Long
-
-
- Type SYSTEM_INFO
- dwOemID As Long
- dwPageSize As Long
- lpMinimumApplicationAddress As Long
- lpMaximumApplicationAddress As Long
- dwActiveProcessorMask As Long
- dwNumberOrfProcessors As Long
- dwProcessorType As Long
- dwAllocationGranularity As Long
- dwReserved As Long
- End Type
-
- 'costanti di GetSystemInfo()
- Public Const PROCESSOR_INTEL_386 = 386
- Public Const PROCESSOR_INTEL_486 = 486
- Public Const PROCESSOR_INTEL_PENTIUM = 586
- Public Const PROCESSOR_MIPS_R4000 = 4000
- Public Const PROCESSOR_ALPHA_21064 = 21064
-
- Public MioSysInfo As SYSTEM_INFO
-
- Declare Sub GetSystemInfo Lib "kernel32" (lpSystemInfo As SYSTEM_INFO)
-
- ' Funzione API GetVolumeInformation
- Declare Function GetVolumeInformation Lib _
- "kernel32" Alias "GetVolumeInformationA" _
- (ByVal lpRootPathName As String, _
- ByVal lpVolumeNameBuffer As String, _
- ByVal nVolumeNameSize As Long, _
- lpVolumeSerialNumber As Long, _
- lpMaximumComponentLength As Long, _
- lpFileSystemFlags As Long, _
- ByVal lpFileSystemNameBuffer As String, _
- ByVal nFileSystemNameSize As Long) _
- As Long
-
-
- ' funzione che trasforma un stringa terminante con zero
- ' in una senza
- Public Function StrNulToStr(ByVal Str_Nul$, ByVal Size As Long) As String
- Dim k, SizeKont As Long
- SizeKont = Size
- If Size = 0 Then SizeKont = 256 ' valore di default se non si passa
- ' alcun argomento per la lunghezza
- For k = 1 To SizeKont
- If Asc(Mid(Str_Nul$, k, 1)) = 0 Then Exit For ' per sicurezza Φ meglio cos∞
- StrNulToStr = StrNulToStr + Mid(Str_Nul$, k, 1)
- Next
- End Function
-
-