Solved

App without a form

Posted on 2000-05-02
7
172 Views
Last Modified: 2010-04-04
How can I have application without a form? Ive tried coding the form to ShowWindow(Application.Handle, SW_HIDE) but I would prefer it to not have a form at all. Also can I still include components with my app as I would not be able to drop the component on the form? Thanks for any help.
Regards
Smurff
0
Comment
Question by:smurff
7 Comments
 
LVL 15

Expert Comment

by:simonet
ID: 2769382
Just the all the forms from the project, and do all the work in the Project source (the .DPR file).

You can still instatiate objects and component, but keep in mind that now you have to do it manually... and remember to free them.

Alex
0
 
LVL 3

Expert Comment

by:raidos
ID: 2769388
Sure you can have an application without forms.

But then you will have to init every Component yourself.

If you can live with the fast that there are forms in the Exe just put this line in the projects source.

Application.ShowMainform := False;


Good Luck

//raidos
0
 

Expert Comment

by:cheka021100
ID: 2769400
Hi,
Just try create the components
in run-time.
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 3

Author Comment

by:smurff
ID: 2769434
cheers, can anyone give an example of a program with just the dpr and how would I initiate the components in runtime?
Thanks again
0
 
LVL 3

Expert Comment

by:shenqw
ID: 2769725
0
 
LVL 1

Accepted Solution

by:
zwarte earned 25 total points
ID: 2769749
exemple1 shows you a dpr file that displays a simple message when compiled and this requires no other code.

exemple 2 shows a dpr file, using a blanc form (unit1) to which it adds a label (I know you don't want a form, but I just wanted to demonstrate that you could create a form and a label at run-time, you can of course also do this for non-visual components, and then you won't need a form to display them, which I now did :-)


exemple1

program Project1;

uses
  Forms,dialogs;

{$R *.RES}

begin
  Application.Initialize;
  showmessage('This is a sample program');
  Application.Run;
end.


exemple2 :


program Project1;

uses
  Forms,dialogs,stdctrls,
  unit1 in 'unit1.pas' {form1};

{$R *.RES}
var
   form1 : tform1;
   label1 : tlabel;
begin
  Application.Initialize;
  showmessage('This is a sample program');
  form1 := tform1.create(application);
  label1 := tlabel.create(form1);
  label1.top := 10;
  label1.left := 10;
  label1.parent := form1;
  label1.caption := 'hello there';
  form1.show;
  showmessage('there you go');
  label1.free;
  form1.free;
  Application.Run;
end.

Tom,
0
 
LVL 3

Author Comment

by:smurff
ID: 2769869
Raidos: your answer with the showmainform was top thanks, but zwart explained alot. Thanks, once again Ive been helped out within a day. Cheers all!!
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
FMX StringGrid1->Canvas->FillRect Problem 3 170
Delphi 2 69
Delphi Yen format 3 45
Need Help Delphi 2010 CheckBox1 Stored value in memo 13 71
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question