I need a little help ASAP with my project... I have an application that will search for all the MP3 files on the computer (searching for *.mp3)... Well, actually, this is the problem, I am using a component for the search (DIFileFinder) and the component will only let you search in a directory, I need to do the following, after the search on the C:\ drives ends to search the other drives, but first I need to detect the local drives on the computer (I need to do that because if the component doesn't find the search dir it won't give an error or do nothing). Also my application is designed not to let you close the app until the search finishes. It doesn't matter if you know a better solution for this (to search all the computer for mp3 files using wildcards) or if you could help me with my code, but I will be very thankfull if you could help me. Below is the relevant code in my app:
THIS IS THE CODE FOR THE CLOSING OF THE FORM (the Complete = 0 will change to 1 when the search is finished.)
: TObject; var Action: TCloseAction);
if Complete = 0 then
Action := caNone;
MessageBox(handle,'Please wait for the search to finish', 'Wait!', MB_OK or MB_ICONERROR);
end else Action := caFree;
THIS IS THE CODE FOR THE SEARCH:
Complet := 0;
while SearchEngine.Next and not SearchEngine.Abort do begin
ShowMessage('We found '+IntToStr(Fisiere.Lines.C
ount)+' MP3 files..'+#10#13#10#13+'Cli
ck Ok to continue.');
Complete := 1;
Here I need the following, after the search is done instead of showing the message (ShowMessage command) if another local drive exists to search that one also, and only then show the message.
PS: I found this code for listing the local drives, so if it makes it easyer for you, you cloud use it: http://www.swissdelphicenter.ch/torry/showcode.php?id=562
Again, if you have a better solution for what I need that would be great also.
Thank you in advance for your help.