|
const cMyExt = '.db'; cMyFileType = 'Project1.FileType'; Reg := TRegistry.Create; try // Set the root key to HKEY_CLASSES_ROOT Reg.RootKey := HKEY_CLASSES_ROOT; // Now open the key, with the possibility to create // the key if it doesn't exist. Reg.OpenKey(cMyExt, True); // Write my file type to it. // This adds HKEY_CLASSES_ROOT\.abc\(Default) = 'Project1.FileType' Reg.WriteString('', cMyFileType); Reg.CloseKey; // Now create an association for that file type Reg.OpenKey(cMyFileType, True); // This adds HKEY_CLASSES_ROOT\Project1.FileType\(Default) // = 'Project1 File' // This is what you see in the file type description for // the a file's properties. Reg.WriteString('', 'Project1 File'); &n [1] [2] [3] 下一页
|