This code finds the processor model, and speed.

VB Code:
  1. Option Explicit
  2. Private Declare Function RegOpenKey Lib "advapi32.dll" Alias "RegOpenKeyA" (ByVal Hkey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
  3. Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal Hkey As Long) As Long
  4. Private Declare Function RegQueryValueEx Lib "advapi32.dll" Alias "RegQueryValueExA" (ByVal Hkey As Long, ByVal lpValueName As String, ByVal lpReserved As Long, lpType As Long, lpData As Any, lpcbData As Long) As Long
  5.  
  6. Private Const REG_SZ = 1
  7. Private Const REG_DWORD = 4
  8. Private Const HKLM = &H80000002
  9.  
  10. Private Sub Main()
  11. Dim Hkey As Long, Speed As Long, Model As String, StrBuff As Long
  12.  
  13. Call RegOpenKey(HKLM, "Hardware\Description\System\CentralProcessor\0", Hkey&)
  14. Call RegQueryValueEx(Hkey&, "~Mhz", 0&, REG_DWORD, Speed&, 4&)
  15. Call RegQueryValueEx(Hkey&, "ProcessorNameString", 0&, REG_SZ, ByVal 0&, StrBuff&)
  16.  
  17. Model$ = Space$(StrBuff&)
  18.  
  19. Call RegQueryValueEx(Hkey&, "ProcessorNameString", 0&, REG_SZ, ByVal Model$, Len(Model$))
  20.  
  21. Model$ = Replace$(Model$, "(tm)", vbNullString)
  22. Model$ = Replace$(Model$, Chr$(0), vbNullString)
  23.  
  24. MsgBox "Processor Model: " & Model$ & vbCrLf _
  25. & "Speed: " & Speed& & "MHz", vbOKOnly, "Processor Info - Coded by Dean"
  26.  
  27. Call RegCloseKey(Hkey)
  28.  
  29. End Sub


-Sir Loin