Solved

App without a form

Posted on 2000-05-02
7
165 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

948 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now