Dear bosses, who will give me some advice! If you click and select multiple files at the same time, what function should you use to transfer all files to the program? Delphi/Windows SDK/API
Http://www.delphi2007.net/DelphiAPI/html/delphi_20061127214337160.html
When you right-click Program These files are also transferred to the program. When you do not right-click the program, it is not open. How can we determine how many files are selected with the mouse, and what are the file names?
For I: = 1 to paramcount do
If fileexists (paramstr (I) Then checkopenfile (paramstr (I ));
the number of parameters can be obtained through paramcount. The usage is as follows:
procedure tform1.formcreate (Sender: tobject);
var
I: integer;
begin
for I: = 1 to paramcount DO
begin
caption: = caption + '-' + paramstr (I );
end;
function paramcount: integer; lets you know how many files are selected (ParamCount-1 files) function paramstr (Index: integer): string; you can get the
file name paramstr (0) of the selected file to return your Executable File Name (appli ). Cation. exename, paramstr (1) return
the first selected file, and so on.
in fact, many things are completed by the operating system. For example, if you select many files and right-click the menu, the operating system is responsible for opening your associated program and passing the selected file as a parameter to you, you can use the above two functions.
you guys, I have tried all of your methods. paramstr can only get the path names of one of several files, but none of them can. How can we get the paths and names of these files?