Hello, is there a way to load files (which are in a given folder) in a listbox automatically at startup of my program?
And perhaps can also delete automatically the contents of that folder when you exit the program?
Thanks
Solved! Go to Solution.
You can use the functions GetFirstFile and GetNextFile to obtain all files with a given search path. The file names can then be inserted into a listbox using InsertListItem.
I'll try and let you know.
thank you very much
regards
Wolfgang Sorry, but I can not make it work. The files that are in the folder C: \ TEST all have the same extension (*. dxf), but I don't know their full name ... the program should recognize their name and add them in the listbox (using their own name).
Hello ViperNaples,
this example should be what you are looking for; it is more complete than what you have described, as it scans also for subdirectories and lists their content also.
How did you use the functions?
For example, GetFirstFile ( "*.dxf", 1, 1, 1, 1, 1, 1, fileName ); returns the first file name matching your search critereon in fileName.
Grazie Roberto, darò un'occhiata all'esempio. I tuoi consigli sono sempre utilissimi ![]()
Wolfgang, i use the function in this way:
GetFirstFile ("c:\\TEST", 1, 0, 0, 0, 0, 0, nameFile);