Pasta do Windows

Delphi

24/01/2007

Boa tarde pessoal::

fiz assim óh!

CODE
{$R *.dfm}

procedure TForm1.BuscaListaArquivosPasta(pasta, nome : string);
var
x: integer;
SearchRec: TSearchRec;
intControl: integer;
Name: string;
begin
lst.Clear;
intControl:=FindFirst(pasta + ´\*´ + nome + ´*.*´, faArchive, SearchRec);
if intControl = 0 then
begin
while (intControl = 0) do
begin
Name:=ExtractFileName(SearchRec.Name);
if Name <> ´´ then
ListItem:= lst.Items.Add;
ListItem.Caption:= SearchRec.Name;
ListItem.SubItems.Add(pasta + ´\´ + SearchRec.Name);
intControl:=FindNext(SearchRec);
end;
FindClose(SearchRec);
end;
end;

procedure TForm1.btnSearchClick(Sender: TObject);
begin
BuscaListaArquivosPasta(txtPasta.Text, txtNome.Text);
end;

procedure TForm1.lstDblClick(Sender: TObject);
begin
ShellExecute(Handle, ´Open´, Pchar(lst.ItemFocused.Caption), nil, (Pchar(lst.Selected.SubItems.Text)), SW_NORMAL);
end;

end.



o problema eh q ele esta somente abrindo os arquivos q estao no diretorio C:\Windows

c eu tentar abrir algum arquivos q estiver na C:\Documents and Settings\User\Meus documentos por exemplo ... naum abre


oke q tm de errado sera?

ps: 1ª columa do listview eh o nome do arquivos
e a 2ª coluna eh o caminho completo do arquivo


Output

Output

Curtidas 0
POSTAR