def WriteRegistryValue(hiveKey, key, name, typeId, data):
    """ Simple api to write one value to Windows registry. 
    If 'name' is empty string, writes to default value."""
    try:
        keyHandle = OpenRegistryKey(hiveKey, key)
        win32api.RegSetValueEx(keyHandle, name, 0, typeId, data)
        win32api.RegCloseKey(keyHandle)
    except Exception, e:
        print "WriteRegistry failed:", e
 Simple api to write one value to Windows registry. 
    If 'name' is empty string, writes to default value.
recipes/Python/528893_PathCatcher__Windows_utility_rightclick_capture_/recipe-528893.py