在 Delphi 11 Alexandria 的 Windows 10 中的 32 位 VCL 应用程序中,我有一个TRzShellTree
控件(来自 GetIt 中可用的 Konopka Signature VCL Controls 7.0 的 Ray Konopka):
object RzShellTree1: TRzShellTree
Left = 0
Top = 41
Width = 201
Height = 428
Align = alLeft
BaseFolder.Pidl = {
004301000014001F50E04FD020EA3A6910A2D808002B30309D19002F433A5C00
00000000000000000000000000000000000054003100000000003D5465581100
44454C50484900003E0009000400EFBE1423F90E42549B502E00000000930F00
000001000000000000000000000000000000DFED4800440045004C0050004800
4900000016005A0031000000000042546956100053757065724D525500004200
09000400EFBE2154F655425469562E000000210A000000004B00000000000000
0000000000000000C43CDA00530075007000650072004D005200550000001800
660031000000000042546F56100050524F4A45437E3100004E0009000400EFBE
4254695642546F562E00000043EB0A0000000B00000000000000000000000000
000008E22E00500052004F004A004500430054002000470052004F0055005000
5300000018000000}
Indent = 19
ReadOnly = True
SelectionPen.Color = clBtnShadow
TabOrder = 0
OnChange = RzShellTree1Change
OnDragOver = RzShellTree1DragOver
end
...在TRzShellTree.OnAddItem
事件处理程序中,我需要获取每个添加文件夹的 PATH:
procedure TformMain.RzShellTreeGroupsAddItem(Sender: TObject; ParentIShf: IShellFolder_NRC; ParentAbsIdList, ItemRelIdList: PItemIDList; Attribs: Integer; var AllowAdd: LongBool);
begin
// How to get the PATH of the added folder?
end;
我认为这可以通过从ItemRelIdList: PItemIDList
参数中提取路径来完成。但我不知道该怎么做。