uses
  ftypesAPI;

var
  ftr    : TFileTypeRegistration;
  s:String;


ftr := TFileTypeRegistration.Create;
if(ftr <> nil) then begin
  try
    if(LOWORD(wp) = IDC_CREATEFOO) then begin
      if(ftr.RegisterType('.foo','FooFile','FOO-File')) then begin
        ftr.AddHandler('open','notepad.exe "%1"','Öffnen');
        ftr.AddHandler('print','notepad.exe /p "%1"');
        ftr.SetDefaultHandler;
        ftr.AddNewFileSupport('.foo');
      end;
    end;
    if(LOWORD(wp) = IDC_DELPRINTVERB) then begin
      if(ftr.GetInternalKey('.foo') <> '') then begin
        ftr.DeleteHandler('print');
        ftr.SetDefaultHandler('open');
      end;
    end;
    if(LOWORD(wp) = IDC_REMOVEFOO) then begin
      s := ftr.GetInternalKey('.foo');
      if(MessageBox(hwndDlg,pchar('Wollen Sie wirklich ".foo" und "' + s + '" entfernen?'), 'Frage',MB_YESNO or MB_DEFBUTTON2 or MB_ICONQUESTION) = ID_YES) then
        ftr.UnregisterType('.foo');
    end;
  finally
    ftr.Free;
  end;
end;