Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   Delphi Contextmenü im Explorer bei doc-Dateien (https://www.delphipraxis.net/19661-contextmenue-im-explorer-bei-doc-dateien.html)

Mario 6. Apr 2004 20:00


Contextmenü im Explorer bei doc-Dateien
 
Hallo,

ich wollte einen Kontext-Menü Eintrag bei Doc-Dateien im Explorer erzeugen. Das klappt auf Basis der Delphi-Demo gut. Nun habe ich UpdateRegistry verändert, um DOC-Dateien zu bearbeiten:

Delphi-Quellcode:
procedure TContextMenuFactory.UpdateRegistry(Register: Boolean);
var
  ClassID: string;
begin
  if Register then begin
    inherited UpdateRegistry(Register);

    ClassID := GUIDToString(Class_ContextMenu);
    CreateRegKey('.doc\shellex', '', '');
    CreateRegKey('.doc\shellex\ContextMenuHandlers', '', '');
    CreateRegKey('.doc\shellex\ContextMenuHandlers\ContMenu', '', ClassID);

    if (Win32Platform = VER_PLATFORM_WIN32_NT) then
      with TRegistry.Create do
        try
          RootKey := HKEY_LOCAL_MACHINE;
          OpenKey('SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions', True);
          OpenKey('Approved', True);
          WriteString(ClassID, 'Delphi Context Menu Shell Extension Example');
        finally
          Free;
        end;
  end
  else begin
    DeleteRegKey('.doc\shellex\ContextMenuHandlers\ContMenu');
    DeleteRegKey('.doc\shellex\ContextMenuHandlers');
    DeleteRegKey('.doc\shellex');

    inherited UpdateRegistry(Register);
  end;
end;
Leider erscheint gar nichts im Kontextmenü des Exploreres. Probiere ich das gleiche mit der noch nicht registrierten Endung .dor, funktioniert alles wie gewünscht.

Was muss ich bei Doc-Datein bzw. bei bereits registrierten Dateien beachten?

neolithos 6. Apr 2004 20:25

Re: Contextmenü im Explorer bei doc-Dateien
 
Bei mir verweist .doc auf Word.Document8 und wenn man dort das Kontextmenü einträgt, sollte es erscheinen.

Also bei .doc erstmal den Std.-Eintrag prüfen, ob da was vorhanden ist. Und dann dort das Kontextmenü hinzufügen!

Mario 7. Apr 2004 08:23

Re: Contextmenü im Explorer bei doc-Dateien
 
Oh, dass schaue ich mir mal an. Danke!


Alle Zeitangaben in WEZ +1. Es ist jetzt 03:01 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz