How can I minimize the space occupied by the Program (if possible, can I list all the methods ?)

Source: Internet
Author: User
How can I minimize the space occupied by the Program (if possible, can I list all the methods ?) Delphi/Windows SDK/API
Http://www.delphi2007.net/DelphiAPI/html/delphi_20061109112042268.html
If I only need a simple function Code For example:
Windows. Beep (, 10); // enable speaker D.

The size of the file generated after I press F9 is 359kb.

Question 1: Why does a simple function occupy such a large space?

Question 2: How many solutions are there? How can this problem be solved?

Question 3: If you want to use Delphi to write large Program , How to write it to make the program smaller and more convenient to update? (I mainly want to ask about the program structure, such as how to implement modular design =)

I am a beginner. Well, I am a little confused. Don't be surprised.

Oh, I suggest you look at the aimingoo predecessors <DelphiSource codeAnalysis> this book,

Http://www.china-pub.com/computers/common/info.asp? Id = 15247

Write the console app.
Then, remove the sentence {$ app .. console} on the console.
Reference windows. Pas
Create a pure SDK program.

Project-> Option package removes unnecessary packages and then compiles them.

Do not use VCL in the program, and use pure API for writing. The EXE size will be much smaller. The minimum value is 10 KB.

PE format minimum 1.5
You can use the DOS com format.

Uses windows;

Begin
Beep (, 10 );
End;
This should be the smallest

Finally, compile it for about 8 KB. I tried it.

Use console application, do not use VCL, use pure API to write

Use ASPack for compression

If components are used, there is a set of keys or something, which the Rus are engaged in. It is strong and used to replace VCL. For example, this simple program is less than 100 kb and VCL is also used.

Volume sensitive?

The error message returned when the PE format is at least 3.5 kb //

This degree of program ASPack compression will increase the volume ..

Com format ..

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.