[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 406
  • Last Modified:

Start HIDDEN

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
alona041797
Asked:
alona041797
1 Solution
 
mosiCommented:
Did you try to put this in your projectfile
 Showwindow(application.handle,SW_HIDE)
just before application.run ?

 
0
 
alona041797Author Commented:
That doesn't work! The project starts a taskbar icon, hides the taskbar icon and then shows the form normally!!
0
 
mirek071497Commented:
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
icampbe1Commented:
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
 
alona041797Author Commented:
I need to check both of your answers and grade the best one... wait a day or two...
0
 
mirek071497Commented:
we are waiting more than 3 weeks !
0
 
alona041797Author Commented:
... oops ... I'll check your answers ... wait ...
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now