I have created some code that searches the system for files
it then populates a Listview with the details the columns being
caption = path
subitem = filename
subitem = datemodified
the idea being that when the user clicks on the 'path'
column it shells explorer at the folder so you can see the file . This works fine when clicking on the path column, the problem is when the user clicks on a subitem/column like 'filename' it raises an exception it also raises an exception when the 'path' column is empty . Below is the problem code . I would really appreciate if someone could show me how to solve this problem.
thanks
CODE:
{=======================================================)
procedure TForm1.ListView1Click(Sender: TObject);
var
ListItem: TListItem;
addr:string;
begin
ListItem := Listview1.Items[
Listview1.ItemIndex] ;
edit4.Text := pchar(ListItem.caption);
addr:=edit4.Text;
ShellExecute(Handle, 'open', 'explorer.exe',Pchar(addr), 0, SW_SHOW);
end;
{=========================================================}
Thanks again
it then populates a Listview with the details the columns being
caption = path
subitem = filename
subitem = datemodified
the idea being that when the user clicks on the 'path'
column it shells explorer at the folder so you can see the file . This works fine when clicking on the path column, the problem is when the user clicks on a subitem/column like 'filename' it raises an exception it also raises an exception when the 'path' column is empty . Below is the problem code . I would really appreciate if someone could show me how to solve this problem.
thanks
CODE:
{=======================================================)
procedure TForm1.ListView1Click(Sender: TObject);
var
ListItem: TListItem;
addr:string;
begin
ListItem := Listview1.Items[
Listview1.ItemIndex] ;
edit4.Text := pchar(ListItem.caption);
addr:=edit4.Text;
ShellExecute(Handle, 'open', 'explorer.exe',Pchar(addr), 0, SW_SHOW);
end;
{=========================================================}
Thanks again