Jag undrar om det finns någon som vet om det finns något API för att kolla CPU-hastigeten... Hej Detta skall funka Provade din kod men i msgboxen fick jag 0 Är det skillnad på om det är amd eller intel. Du kan köra filen regedt32.exe som finns på din dator och titta ner i registret om sökvägen "HARDWARE\DESCRIPTION\System\CentralProcessor\0"CPU...
//ChristianSv: CPU...
http://www.programmersheaven.com/search/advsearch.asp?SearchMode=1&SearchTxt1=CPU
mvh
SvenSv: CPU...
Private Const sCPURegKey = "HARDWARE\DESCRIPTION\System\CentralProcessor\0"
Private Const HKEY_LOCAL_MACHINE As Long = &H80000002
Private Declare Function RegCloseKey Lib "advapi32.dll" _
(ByVal hKey As Long) As Long
Private Declare Function RegOpenKey Lib "advapi32.dll" _
Alias "RegOpenKeyA" _
(ByVal hKey As Long, _
ByVal lpSubKey As String, _
phkResult As Long) As Long
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
Private Sub Form_Load()
MsgBox GetCPUSpeed
End Sub
Private Function GetCPUSpeed() As Long
Dim hKey As Long
Dim cpuSpeed As Long
'Open CPU key
Call RegOpenKey(HKEY_LOCAL_MACHINE, sCPURegKey, hKey)
'and retrieve the value
Call RegQueryValueEx(hKey, "~MHz", 0, 0, cpuSpeed, 4)
Call RegCloseKey(hKey)
GetCPUSpeed = cpuSpeed
End Function
Mvh Henrik BengtssonSv: CPU...
SJSv: CPU...
leder dig till en nyckel som heter ~Mhz..