Hi is it possible to get the speed (MHz) to which a CPU has been overclocked to using VB.net?
I have tried the "Win32 Processor class" but can only get the rated CPU speed from that.
Any idea how to get this?
Thanks
Hi is it possible to get the speed (MHz) to which a CPU has been overclocked to using VB.net?
I have tried the "Win32 Processor class" but can only get the rated CPU speed from that.
Any idea how to get this?
Thanks
This is not possible using this class.
How to make it working
long lError = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
"HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0",
0,
KEY_READ,
&hKey);
if(lError != ERROR_SUCCESS)
{// if the key is not found, tell the user why:
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
lError,
0,
Buffer,
_MAX_PATH,
0);
AfxMessageBox(Buffer);
return "N/A";
}
// query the key:
RegQueryValueEx(hKey, "~MHz", NULL, NULL, (LPBYTE) &dwMHz, &BufSize);
// convert the DWORD to a CString:
sMHz.Format("%i", dwMHz);
return sMHz;