Solved

App without a form

Posted on 2000-05-02
7
164 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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
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…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

760 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

23 Experts available now in Live!

Get 1:1 Help Now