Private 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
Private Declare Sub GetSystemInfo Lib "kernel32" (lpSystemInfo As SYSTEM_INFO)
'GetSystemInfo Constants
Const PROCESSOR_INTEL_386 = 386
Const PROCESSOR_INTEL_486 = 486
Const PROCESSOR_INTEL_PENTIUM = 586
Const PROCESSOR_MIPS_R4000 = 4000
Const PROCESSOR_ALPHA_21064 = 21064
Private Sub cGetSystemInfo()
Dim V As SYSTEM_INFO, Info$
Dim NoOfProcessors$, ProcessorType$, PageSize$
GetSystemInfo V
NoOfProcessors = V.dwNumberOrfProcessors
ProcessorType = V.dwProcessorType
Select Case ProcessorType
Case PROCESSOR_INTEL_386
Info = Info & "Intel 386" & vbCrLf
Case PROCESSOR_INTEL_486
Info = Info & "Intel 486" & vbCrLf
Case PROCESSOR_INTEL_PENTIUM
Info = Info & "Intel Pentium" & vbCrLf
Case PROCESSOR_MIPS_R4000
Info = Info & "MIPS R4000" & vbCrLf
Case PROCESSOR_ALPHA_21064
Info = Info & "DEC Alpha 21064" & vbCrLf
Case Else
Info = Info & "(неизвестно)" & vbCrLf
End Select
MsgBox "Количество процессоров: " & NoOfProcessors & vbCrLf & "Тип роцессора: " & _ Info, vbOKOnly + vbInformation
End Sub |
|