function ShellDoContextMenuVerb(Folder: IShellFolder; Pidl: PItemIDList;
Handle: THandle; Verb: string): Boolean;
var CM: IContextMenu;
ICI: TCmInvokeCommandInfo;
begin
result:=False;
if Assigned(Folder) then
begin
if (Folder.GetUIObjectOf(
Handle, 1, Pidl, IID_IContextMenu, nil, CM) = NOERROR) then
begin
ZeroMemory(@ICI, sizeof(ICI));
ICI.cbSize:=sizeof(TCmInvokeCommandInfo);
ICI.hwnd:=
Handle;
ICI.fMask:=CMIC_MASK_ASYNCOK;
ICI.lpVerb:=PAnsiChar(AnsiString(Verb));
ICI.nShow:=SW_SHOWNORMAL;
result:=Succeeded(CM.InvokeCommand(ICI));
CM:=nil;
end;
end;
end;