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?

Source: Internet
Author: User
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?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.