Mega Code Archive

 
Categories / Delphi / Files
 

Filling a list box with like files (long filenames)

Title: Filling a list box with like files (long filenames) Question: How to find all the .txt filed in a specified directory or .bmp? Answer: var SearchRec: TSearchRec; begin if FindFirst('C:\WINDOWS\*.BMP',0, SearchRec) = 0 then repeat CheckListBox2.Items.Add(SearchRec.name); until FindNext(SearchRec) 0; FindClose(SearchRec); end; //Find out files for a wallpaper changer app. Answer to my own question! //Please note: I think the variable (searchred) returns other info about // the file(s) found but i'm not sure about how to access it! somebody know, //please elt me in on it!