I got a request from TDU today. He wanted to access to windows registry, but didn't know how to by programming using delphi.
So basically this code will show you how to associate/desassociate an extension with the icon of your application.
Please login or register to download
Use full direct downloader
If you wan to use it for other purposes this is basically always the same structure:
need to use the TRegistry of delphi.
Create your class. TRegistry.Create;
what is the root key of where you want to search in the registry: reg.RootKey := HKEY_CLASSES_ROOT;
now you may do what you want:
reg.KeyExists: Tests the existence of the key.
reg.OpenKey: Opens a key to access some values within.
reg.WriteString: Write the string you want to write.
there are others too... Names are pretty much straight foward...
reg.CloseKey: At the end always close the key you just opened.
reg.Free; Free the class created.
This is a tutorial from Developers Heaven team.
Join to share your knowledge and have fun...