Delphi Export Registry File

Does anyone know a way to Create a.REG file. Draft survey pdf. Similar to the way Regedit does so it can be edited with a text editor, and imported to the registry by double-click on it. Import/Export of Registry Keys in Delphi. How to export/import Registry settings under Vista?
I need to get the name of the program currently associated with a file extension for the current user. If you right-click on a file and select properties, then what I need is the program name that is to the right of the 'Opens with' line.
For '.xls', I want to be able to get the answer 'Microsoft Office Excel', or whatever program the user has as their default program to open.xls files. I have determined it's not as easy as just going into HKEY_CLASSES_ROOT and picking it out, since it may also be specified in HKEY_LOCAL_MACHINE or HKEY_CURRENT_USER or HKEY_USERS.
Maybe all I need to know is the pecking order used by Windows to determine this and how to get to each of the locations. Of course, a Windows API call to do this would be ideal. This is a similar question to: but that question only answered how to get the description of the extension and the icon of the associated program.
I couldn't find a way to extend that to also get the name of the associated program. I'm using Delphi 2009 and need a solution that works on Windows XP, Vista and 7. Thank you all for your answers. It appears my belief that the name of the executable is not in the Registry after all.
And after looking around extensively for a Windows API that will give the name, I could not find one. I think Mef's answer then is the best. To get the name of the executable from the information included in the program's executable.
@lkessler: You can specify a file description (and an ext description) when registering an extension (what marc_s described) - I thought that is what Windows uses in the Open With Dialog. But I may be wrong.
I thought about it, and I came to the conclusion that there can't be a specific place in the Registry where Application Names are stored - because 'Open With' works with exes that don't write anything to Registry semselfs as well, you can test this with a simple blank WinForm;-) The interesting part is what name is displayed, I don't know =) – Apr 6 '10 at 11:48 •. Don't go spelunking in the registry when there are API functions designed to do what you need.
In your case, you want. You can give it the file-name extension, and it will tell your the program registered to handle that extension ( AssocStr_Executable). If you're planning on running that program to open a document, then you'll really want the command string instead of just the executable; AssocQueryString can give you that, too ( AssocStr_Command). It can also tell you the document type like what's displayed in Windows Explorer, like 'Text Document' or 'Zip Archive' ( AssocStr_FriendlyDocName).