procedure SetContextMenu(Root,Ext: string); var sTypeName: string; begin with TRegistry.Create do try RootKey := Root; { Set the extension you want. Include the '.' character } OpenKey('.'+LowerCase(Ext), True); { Get file type name } sTypeName := ReadString(''); CloseKey; { Create explorer extension. Instead of 'Open' put whatever you want. } OpenKey('' + sTypeName + 'ShellOpen', True); { The context menu item } WriteString('', 'Play with MiniPlayer'); CloseKey; OpenKey('' + sTypeName + 'ShellOpenCommand', True); { The commandline. Enter all the commandline options you need. Remember to use quotes for long file names with spaces. Even if your application's filename doesn't contain any spaces the folder that it's in may contain them. %1 - is the selected file's name. } WriteString('', '"' + Application.ExeName + '" "%1"'); CloseKey; finally Free; end; end;
Como verán el code lo hice como un procedimiento, ahora, hay ciertas cosas como dije anteriormente que no las tengo muy claro, y las dudas las tengo en las siguientes líneas:
sTypeName := ReadString('');
{ Create explorer extension. Instead of 'Open' put whatever you want. } OpenKey('' + sTypeName + 'ShellOpen', True);
OpenKey('' + sTypeName + 'ShellOpenCommand', True);
En esas tres líneas no entiendo que debo poner en sTypeName, no sé a qué se refiere con ShellOpen y ShellOpenCommand, nada de nada, a ver si alguno de ustedes me trae la luz en este asunto.
Saludos.