Another code from the archives..
printf( "Path: %s", GetBrowserPath( ) );
char* GetBrowserPath( )
{
HKEY hKey;
char szBuffer[1080];
unsigned long lSize = sizeof( szBuffer ) + 1;
if( RegOpenKeyEx( HKEY_CLASSES_ROOT, "http\\shell\\open\\command", 0, KEY_ALL_ACCESS, &hKey ) == 0 ) {
if( RegQueryValueEx( hKey, NULL, NULL, NULL, (unsigned char*)szBuffer, &lSize ) == 0 ) {
RegCloseKey( hKey );
return( strtok( szBuffer, "\"" ) );
}
RegCloseKey( hKey );
}
return( "Unknown" );
}