/ Published in: C++
RegGetValue apparently isn't available in XP SP2. I tried and got an error. MSDN implied it wasn't available.
Example usage to get versions of browsers:
GetRegString( HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Internet Explorer", "Version" );
GetRegString( HKEY_LOCAL_MACHINE, "Software\\Mozilla\\Mozilla Firefox", "CurrentVersion" );
Example usage to get versions of browsers:
GetRegString( HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Internet Explorer", "Version" );
GetRegString( HKEY_LOCAL_MACHINE, "Software\\Mozilla\\Mozilla Firefox", "CurrentVersion" );
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// Get Registry string value. // Example usage: // GetRegString( HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Internet Explorer", "Version" ); // GetRegString( HKEY_LOCAL_MACHINE, "Software\\Mozilla\\Mozilla Firefox", "CurrentVersion" ); CString GetRegString( HKEY hKeyArg, LPCSTR keyNameArg, LPCSTR valNameArg ) { CString s; CRegKey k; k.Open( HKEY_LOCAL_MACHINE, keyNameArg ); ULONG len = 255; k.QueryStringValue( valNameArg, s.GetBufferSetLength( len ), &len ); s.ReleaseBuffer(); return s; }