def ReadRegistryValue(hiveKey, key, name):
    """ Simple api to read one value from Windows registry. 
    If 'name' is empty string, reads default value."""
    data = typeId = None
    try:
        hKey = win32api.RegOpenKeyEx(hiveKey, key, 0, win32con.KEY_ALL_ACCESS)
        data, typeId = win32api.RegQueryValueEx(hKey, name)
        win32api.RegCloseKey(hKey)
    except Exception, e:
        print "ReadRegistryValue failed:", e
    return data, typeId
 Simple api to read one value from Windows registry. 
    If 'name' is empty string, reads default value.
recipes/Python/528893_PathCatcher__Windows_utility_rightclick_capture_/recipe-528893.py