This piece of code will setup an auto-open icon. When the file applying to the icon is clicked, the program will open automatically. String ProgExe = ExtractFilePath(Application->ExeName); String ProgramPath = ProgExe; ProgExe = ProgExe + ExtractFileName(Application->ExeName) + " %1"; TRegistry* regKey = new TRegistry(); regKey->RootKey = HKEY_CLASSES_ROOT; // register icon if(!regKey->ReadString("\\RUS_auto_file\\shell\\open\\command").Pos('1')); { regKey->OpenKey("\\.RUS",true); regKey->WriteString("","RUS_auto_file"); regKey->OpenKey("\\RUS_auto_file",true); regKey->OpenKey("\\RUS_auto_file",true); regKey->WriteString("", "RUS Russian Text File"); regKey->OpenKey("\\RUS_auto_file\\DefaultIcon",true); regKey->WriteString("",(ProgramPath) + "RusIcon.ico,0"); regKey->OpenKey("\\RUS_auto_file\\shell\\open\\command",true); regKey->WriteString("", ProgExe); } This is the code needed within the program to ensure the file clicked is loaded by the program. if(ParamCount() == 1) Compensate->LoadFromFile(ParamStr(1));