Const HKEY_LOCAL_MACHINE = &H80000002
Sub GetCpuInfo(Description As String, Vendor As String, MHz As Integer, _ Optional CpuNumber As Integer = 1) Dim keyName As String, speed As String keyName = "Hardware\Description\System\CentralProcessor\" & CStr(CpuNumber - _ 1) Description = GetRegistryValue(HKEY_LOCAL_MACHINE, keyName, "Identifier", _ "") Vendor = GetRegistryValue(HKEY_LOCAL_MACHINE, keyName, "VendorIdentifier", _ "") speed = GetRegistryValue(HKEY_LOCAL_MACHINE, keyName, "~MHz", "") If LCase$(Left$(speed, 2)) = "0x" Then MHz = Val("&H" & Mid$(speed, 3)) Else MHz = -1 End If End Sub |