Yes I did try it. The problems with using invisible main form I have
encountered so far are like that:

1) when current form (pretending to be main) gets minimised it does not
completely disappears from screen as real main form would do, but stays
minimised on the _top_ of task bar. This is confusing for a user.

2) clicking application icon _inside_ task bar does not restore pseudo-main
form, as Windows sends messages to real main form which is hidden. To handle
this I do this:

procedure TFormRealMain.OnActivate(Sender: TObject);
begin
    ShowWindow(FormPseudoMain.Handle,SW_RESTORE);
end;

This solves problem 2 but introduces problem 3

3) When user closes last non-minimised application, Windows may, having
nothing else to focus on,  focus on my application's icon on (inside) task
bar. This triggers OnActivate event and above shown code is being executed
and accordingly my current minimised form gets unwillingly restored. If I
knew how to detect if it is user clicked app.icon or app.icon just got
focused by Windows.

I do not know may be there are more problems like these to be discovered
while using hidden main form approach. So I'd prefer to somehow change main
form at run time to gain all normal behavier for my application.

I wish I was an internet developer. Would I care about all this then ?

Regards
Alex

----- Original Message -----
From: "Rohit Gupta" <[EMAIL PROTECTED]>
To: "Multiple recipients of list delphi" <[EMAIL PROTECTED]>
Sent: Monday, 12 June 2000 14:14
Subject: Re: [DUG]: Changing main form at run-time


> Have you tried with the mainform visible set to false ?  If that failes,
> set its position to off the screen.
>
> To:             Multiple recipients of list delphi <[EMAIL PROTECTED]>
> Send reply to:  [EMAIL PROTECTED]
> From:           "Alex Kouznetsov" <[EMAIL PROTECTED]>
> Subject:        [DUG]:  Changing main form at run-time
> Date sent:      Mon, 12 Jun 2000 13:18:24 +1000
>
> > Hi
> >
> > Is there any way to change main application form at run-time ?
> > After Application.Run call preferably.
> >
> > Something like that :
> > 1) run application as normal with some kind of a base main form
> > 2) get some kind of user input
> > 3) get rid of current main form (destroy) and create and bring up
another
> > one which has to behave as main form.
> >
> > I have tried hiding base main application form and letting the user to
> > interact with secondary form as if it was an application main form.
> > Unfortunately this way I get lots of little annoying problems with
> > application activating, minimizing,restoring etc.
> >
> > Thanks
> > Alex
> >
>
> --------------------------------------------------------------------------
-
> >     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
> >                   Website: http://www.delphi.org.nz
>
>
>
> Rohit
>
> ======================================================================
> CFL - Computer Fanatics Ltd.  21 Barry's Point Road, AKL, New Zealand
> PH    (649) 489-2280
> FX    (649) 489-2290
> email [EMAIL PROTECTED]  or  [EMAIL PROTECTED]
> ======================================================================
>
> --------------------------------------------------------------------------
-
>     New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
>                   Website: http://www.delphi.org.nz
>

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to