Solved

Start HIDDEN

Posted on 1997-08-22
7
396 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

707 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

18 Experts available now in Live!

Get 1:1 Help Now