?
Solved

App without a form

Posted on 2000-05-02
7
Medium Priority
?
179 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 100 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

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 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…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses
Course of the Month8 days, 8 hours left to enroll

765 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