Solved

Start HIDDEN

Posted on 1997-08-22
7
398 Views
Last Modified: 2010-05-18
I want a delphi 2 app (with forms) to start with its main form hidden, and not show any icon in the taskbar of the task list. Also, I DO NOT want it to appear for a second and just then diapper, I want it to never appear in the first place.

More points may be granted if needed.
0
Comment
Question by:alona041797
7 Comments
 
LVL 1

Expert Comment

by:mosi
ID: 1342231
Did you try to put this in your projectfile
 Showwindow(application.handle,SW_HIDE)
just before application.run ?

 
0
 
LVL 2

Author Comment

by:alona041797
ID: 1342232
That doesn't work! The project starts a taskbar icon, hides the taskbar icon and then shows the form normally!!
0
 
LVL 3

Accepted Solution

by:
mirek071497 earned 50 total points
ID: 1342233
You mast add this to You'r MainForm OnCreate event.

procedure TForm1.FormCreate(Sender: TObject);
begin
  Left := -1000;  { You'r form is invisible on screen }
  showwindow( FindWindow (nil,@Application.Title[1]),sw_hide);  { application is invisible on task bar }
end;

0
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
LVL 2

Expert Comment

by:icampbe1
ID: 1342234
Hi there alona,

Part one of your question is easy without dicking around and setting its location off screen.  Simple go to the DPR file and do the following:

PROGRAM HideForm;

USES
   Forms, OtherStuff;

{$R *.RES}

BEGIN
   Application.Initialize;
   Application.ShowMainForm := FALSE;  <-- Prevents form showing
   Application.CreateForm( TFormType, FormInstance );
   Application.Run;
END.

This is exactly what the ShowMainForm property was meant for.

Now part two of your question.  Do the following:

CONSTRUCTOR TForm1.Create( AOwner: TComponent );
BEGIN
   Inherited Create( AOwner );      {Create the object instance}

   ShowWindowAsync( (Owner AS TApplication).Handle, SW_HIDE );
END;

I hope this helps you out.
Cheers,
Ian C.
0
 
LVL 2

Author Comment

by:alona041797
ID: 1342235
I need to check both of your answers and grade the best one... wait a day or two...
0
 
LVL 3

Expert Comment

by:mirek071497
ID: 1342236
we are waiting more than 3 weeks !
0
 
LVL 2

Author Comment

by:alona041797
ID: 1342237
... oops ... I'll check your answers ... wait ...
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

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…
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…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

785 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