Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

ShellNotify - PIDL attributes

The ShellNotify demo just lists the path of items, e.g. when a drive is attached, etc. However there are (or should be) lots more attributes associated with a Notification event such as ProductName, SerialNbr, PhysicalDescriptor, etc. The only function used to return info about a PIDL in the Demo is LMDPathFromPIDL and I can find no documentation or hints about other functions. Are there any other functions or methods to access more info from teh PIDL?  

Comments

  • 6 Comments sorted by Votes Date Added
  • TLMDShellItem class provides a lot of information about a shell item including Details string list and DetailsEx indexes property.
  • I'm sorry, but TLMDShellItem is never mentioned in any of the demo files or lmd wiki, how am I supposed to do anything with this? 
  • You can create shell items from PIDL as follows:

    procedure TForm24.Button1Click(Sender: TObject);
    var
      itm:  TLMDCustomShellItem;
      pidl: PItemIDList;
      dnfo: TShellItemDetailsInfoArray;
      i:    Integer;
      s:    string;
    begin
      pidl := (LMDShellList1.SelectedItem as TLMDShellItem).PIDL;
      itm  := LMDShellFolder1.CreateShellItem(pidl);
      try
        dnfo := itm.GetDetailsInfo;
        for i := 0 to High(dnfo) do
        begin
          if dnfo[i].View <> '' then
          begin
            s := dnfo[i].Title + ': ' + dnfo[i].View;
            Memo1.Lines.Add(s);
          end;
        end;
      finally
        itm.Free;
      end;
    end;

    Alternatively, controls like TLMDShellList or TLMDShellTree provides properties like SelectedItem, which also gave access to the corresponding shell items.
  • Thank you, that looks like something I can work from.
  • ... Maybe not. This works for USB drives but other units such as a USB dongle, USB to serial cable or USB mouse generate a notification event but the ShellItem details contain basically garbage (View = Title for 300+ generic items). 
    Do any of your other components work with non-drive shellitems?
  • We do not any special component. The data is represented as it reported by Windows. And its main purpose is to be used in GUI controls, like TLMDShellList and TLMDShellTree.
Sign In or Register to comment.