In a Delphi 10.4.2 win-32 VCL Application in Windows 10, I register the .ICO file format for my graphics application by using DSiWin32.DSiRegisterUserFileAssoc:
DSiRegisterUserFileAssoc(
'.ico', // extension: .ico
'UGAICOFile', // progID: UGAICOFile
'ICO File', // description: ICO File
'C:\DELPHI\MyApp\MyApp.ico', // Icon File
'"C:\DELPHI\MyApp\Win32\Debug\MyApp.exe" "%1"' // openCommand
);
SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, nil, nil);
This works without problems and when double-clicking an .ICO file in Windows File Explorer my app loads the .ICO file. These Registry keys have been created WITH THE CORRECT VALUES:
HOWEVER, when I try to UNREGISTER the .ICO file format for my graphics application by using DSiWin32.DSiUnregisterUserFileAssoc, it does not work:
procedure TForm1.btnUnregisterClick(Sender: TObject);
begin
DSiUnregisterUserFileAssoc('UGAICOFile');
SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, nil, nil);
end;
The UGAICOFile progID key is not being deleted from the Registry! And double-clicking an .ICO file in File Explorer still loads my app!
Even when I try it in elevated mode (by starting the program as Administrator) it does not work! Could it be that that the Microsoft apps registered under .ico\OpenWithProgrids could stop the key from being removed?
So how can I UNREGISTER the registered .ICO File Format for my application?

