alona041797
asked on
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.
More points may be granted if needed.
ASKER
That doesn't work! The project starts a taskbar icon, hides the taskbar icon and then shows the form normally!!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.
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.
ASKER
I need to check both of your answers and grade the best one... wait a day or two...
we are waiting more than 3 weeks !
ASKER
... oops ... I'll check your answers ... wait ...
Showwindow(application.han
just before application.run ?