Display property sheets for multiple shell objects

I need to display a properties window for certain items: folders and files.

For a single element that displays property windows, it’s very simple - just set the .lpFile field. But I can’t get how to display the properties window for multiple items.

1) Enumerating files in .lpFile as "file1.txt" "file2.txt" "etc. does not work. Even if it does not work, because the list of files may be too large.

2) Work through PIDLIST_ABSOLUTE did not bring any results. You can create PIDLIST_ABSOLUTE for one file through ILCreateFromPath, but cannot merge several PIDLIST_ABSOLUTE into one.

Does anyone have a workaround? Any answers would be appreciated.

PS: As I recently understood, PIDLIST_ABSOLUTE is uniquely created for a specific unique object. Thus, two or more PIDLIST_ABSOLUTE cannot be combined. But the question is still relevant.

+3
source share
2 answers

Call IShellFolder :: GetUIObjectOf, pass a few pidls and request IContextMenu, then call the property verb. - Raymond Chen

Thanks Raymond. He works!

0
source

The easiest way in delphi:

Get DataObject from IExplorerBrowser or from clipboard

 if (OleGetClipboard(LDataObject) = S_OK) then
    SHMultiFileProperties(LDataObject, 0);

Otherwise, use the verb 'properties':

function TExplorerFrame.DoVerb(Verb: AnsiString): Boolean;
var
  LFolderView: IFolderView2;
begin
  Result := False;
  if Supports(FCurrentShellView, IID_IFOLDERVIEW2, LFolderView) then
  begin
    if Verb = 'default' then
      Result := (LFolderView.InvokeVerbOnSelection(nil) = S_OK)
    else
      Result := (LFolderView.InvokeVerbOnSelection(pAnsiChar(@Verb[1])) = S_OK);
  end;
end;
0
source

All Articles