Windows registry file association menu

Recently (today) I started meditating with my registry from Delphi. :) everything works fine, and my user-defined file type is now opened by my program, but there are 2 problems that I cannot solve.

1) I need the open with option of all file types, so I added

  reg := TRegistry.Create;
  reg.RootKey := HKEY_CLASSES_ROOT;
  reg.LazyWrite := false;
  reg.OpenKey('*\OpenWithList\EncryptionSystem', true);
  reg.WriteString('','C:\Program Files\EncryptionSystem\EncryptionSystem.exe "%1"');
  reg.CloseKey;
  reg.free;

If I look in the registry using regedit, it is sure that, as it should be, but when I right-click on the file and select Open With it not there ...

So i added this

  reg.OpenKey('*\shell\Encrypt\command', true);
  reg.WriteString('','C:\Program Files\EncryptionSystem\EncryptionSystem.exe "%1"');
  reg.CloseKey;

, "" "". , , ... , shellext, , ... - , ... shellext ". *", , .

+2
3

, " " . , , Explorer :

HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts

, , , , Explorer - , " " .

, , " " , . EXE , ExcryptionSystem.exe. , , . , .

. MSDN, .

+6

, , .

reg.OpenKey('*\OpenWithList\EncryptionSystem', true);
reg.WriteString('','C:\Program Files\EncryptionSystem\EncryptionSystem.exe "%1"')

reg.OpenKey('*\OpenWithList\EncryptionSystem.exe', true); //note exe
reg.WriteString('','C:\Program Files\EncryptionSystem\EncryptionSystem.exe "%1"')

.

+1

W7P . ...

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts
0

Source: https://habr.com/ru/post/1718070/


All Articles