Open Windows Registry Editor ([url removed, login to view]) and go to HKEY_CLASSES_ROOT\DesktopBackground\Shell\Display. Try to delete that key. You cannot, as Windows shows an error message "Cannot delete key" or "Access denied". You can delete the key, if you adjust its permissions (Right-Click key > Permissions) and then try to delete it.
Your job is to write a Delphi function that takes as an input a registry key path (e.g. "HKEY_CLASSES_ROOT\DesktopBackground\Shell\Display") and it fixes its permissions in a way the key can be deleted.
In other words, I want to be able to run: FixRegPermissionsForKey('HKEY_CLASSES_ROOT\DesktopBackground\Shell\Display'); and after that I am able to delete the mentioned registry key with RegEdit.
The code must compile with Delphi 2010 and the code must work with Windows 7, 8, 8.1. and 10. The code must not require the use of any third party libraries or executables.
Hello, I am an expert delphi programmer for more than 15 years, the program is done waiting for your acceptance of my bid :) , I can show you a demo any time. Thanks, - Shomaf