Yes, it's confusing.
You have to mix the items and folder properties

This is a copy of a code I've used:

 if (Source is TShellListView) then begin
   for N:= 0 to ShellList.Items.Count -1 do
     if ShellList.Items.Item[N].Selected then begin
       if ShellList.Folders[N].IsFolder then begin
           Folder:= ShellList.Folders[N].DisplayName;

HTH

Paul


----- Original Message ----- From: "Ken Phipps" <kphi...@tampabay.rr.com>
To: <delphi@elists.org>
Sent: Saturday, July 11, 2009 5:47 AM
Subject: TShellListView Question - How to select item in code,iterate through items (D7)


I can't figure out how to select an item from code, example: if an item
matches a filename, make that item the focused/selected item. This is for a
custom open dialog, and I want to have the file from the previous session
selected and focused.

Also, I don't see any way to loop through the items. I tried the Items property, but the 'Caption' property is empty for the items. 'Folders' doesn't seem to have any 'Count' property, and I don't see any GetNext type of methods, etc.
_______________________________________________
Delphi mailing list -> Delphi@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi


_______________________________________________
Delphi mailing list -> Delphi@elists.org
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi

Reply via email to