Board index » delphi » How can I minimize form into the taskbar?

How can I minimize form into the taskbar?

Hi there,

how can I minmize a Delphi form into the taskbar?

At this time I'm using the following approach:

procedure TMyForm.CreateParams(var params: TCreateParams);
begin
  with params do exStyle := exStyle Or WS_EX_APPWINDOW;
end;

This works, but has the following disadvantages:

- when a modal dialog is shown, the user can bring another form to the
foreground by clicking into the taskbar
- on pressing <ALT>-<TAB> on sees the application icon for every form.

Any solutions for these problems?

Thanks in advance & regards

Ron.
--
Ronald Queloz
Byron Informatik
Riehenstr. 60                          E-mail: que...@byron.ch
CH-4058 Basel                          WWW:    http://www.byron.ch/byron

 

Re:How can I minimize form into the taskbar?


Delete your CreateParams procedure.
Use
  MyForm.Visible := False;
and
  MyForm.Visible := True;
instead;

Ron Queloz skrev i meddelelsen <367A20BB.5C8F5...@byron.ch>...

Quote
>Hi there,
>how can I minmize a Delphi form into the taskbar?

Re:How can I minimize form into the taskbar?


Hi Finn,

Quote
> Delete your CreateParams procedure.
> Use
>   MyForm.Visible := False;
> and
>   MyForm.Visible := True;
> instead;

You say, you perform "MyForm.Visible := false" on a minmize event and
"MyForm.Visible := true" on a restore event?

But this does not bring the minimized form in the task bar, does it?

Regards

Ron.
--
Ronald Queloz
Byron Informatik
Riehenstr. 60                          E-mail: que...@byron.ch
CH-4058 Basel                          WWW:    http://www.byron.ch/byron

Re:How can I minimize form into the taskbar?


Ron Queloz skrev i meddelelsen <367DF754.673D5...@byron.ch>...

Quote
>Hi Finn,

>> Delete your CreateParams procedure.
>> Use
>>   MyForm.Visible := False;
>> and
>>   MyForm.Visible := True;
>> instead;

>You say, you perform "MyForm.Visible := false" on a minmize event and
>"MyForm.Visible := true" on a restore event?

>But this does not bring the minimized form in the task bar, does it?

No it doesn't. It hides the form. I guessed that was just as good.

Re:How can I minimize form into the taskbar?


Ron Queloz schrieb:

Quote
> Hi Finn,

> > Delete your CreateParams procedure.
> > Use
> >   MyForm.Visible := False;
> > and
> >   MyForm.Visible := True;
> > instead;

> You say, you perform "MyForm.Visible := false" on a minmize event and
> "MyForm.Visible := true" on a restore event?

> But this does not bring the minimized form in the task bar, does it?

> Regards

> Ron.
> --
> Ronald Queloz
> Byron Informatik
> Riehenstr. 60                          E-mail: que...@byron.ch
> CH-4058 Basel                          WWW:    http://www.byron.ch/byron

Yu must set the property "WindowState" of the form.

  Form1.WindowState:= wsMinimized;

I'm not sure, but that must do it.

J.J.

Other Threads