unit ShellExtMain;
interface
uses
ComServ, SysUtils, ShellAPI, Windows, Registry,
ActiveX, ComObj, ShlObj,
Graphics, classes, inifiles;
const
GUID_TDFKontextMenuShellExt: TGUID = '
{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}';
type
TDFKontextMenuShellExt =
class(TComObject, IShellExtInit, IContextMenu)
protected
function IShellExtInit.Initialize = SEInitialize;
function SEInitialize(pidlFolder: PItemIDList; lpdobj: IDataObject; hKeyProgID: HKEY): HResult;
stdcall;
function QueryContextMenu(Menu: HMENU; indexMenu, idCmdFirst, idCmdLast, uflags: UINT): HResult;
stdcall;
function InvokeCommand(
var lpici: TCMInvokeCommandInfo): HResult;
stdcall;
function GetCommandString(idCmd, uType: UINT; pwReserved: PUINT; pszName: LPSTR; cchMax: UINT): HResult;
stdcall;
end;
(...)
initialization
// Initialisierung
TDFKontextMenuShellExtFactory.Create(ComServer, TDFKontextMenuShellExt, GUID_TDFKontextMenuShellExt,
'
', '
Programmname', ciMultiInstance, tmApartment);
(...)
end.