Board index » delphi » Minimizing an application so it shows NO forms

Minimizing an application so it shows NO forms

This is an incredibly stupid problem, but I haven't a clue how to fix
it: How do I build an application that on startup minimizes itself so
all that is visible is an icon on the Taskbar.

Calling Application.Minimize does minimize the App, but the main form
that is automatically created does show up.
If I set the WindowState propery of the main form to Minimized, I get
a tiny window in the lower left corner of the screen.
Calling ShowWindow with SW_HIDE and fiddling with the Visible property
doesnt have any effect. The window _still_ shows up.

Any ideas?

Thanks.

Bas Pluim.
b...@defacto.nl

 

Re:Minimizing an application so it shows NO forms


Bas Pluim wrote in a message to All:

BP> From: b...@defacto.nl (Bas Pluim)

BP> This is an incredibly stupid problem, but I haven't a clue how to
BP> fix  it: How do I build an application that on startup minimizes
BP> itself so  all that is visible is an icon on the Taskbar.

We faced the same problem, and solved it. The solution is in a file called
MNFIX100.ZIP, a DCU for Delphi that allows you to run programs minimized. The
default behaviour of the unit is to run the program minimized only when Windows
asks for it, but that can easily be changed. The file is available on
CompuServe and on the following WWW sites:

  Delphi Super Page
    http://sunsite.icm.edu.pl/archive/delphi/

  Temple of Delphi
    http://www.coast.net/~jkeller/index.html

  The Delphi Connection
    http://www.delphi32.com/

Best regards,
   Christian // ctib...@silver.ct.se

.. EXPERT: called in at the last minute to share the blame.

Re:Minimizing an application so it shows NO forms


Quote
> it: How do I build an application that on startup minimizes itself so
> all that is visible is an icon on the Taskbar.

Try to call ShowWindow with Application.Handle, NOT MainWindow.Handle.

That should help..

-->Robert<--

Re:Minimizing an application so it shows NO forms


This is probally cheating but it works. I created a lable with a
single letter on my form. Double clicked it to generate the on click
code. Put in Application.Minimize. For the form Events OnResize I
linked it to the OnLabel click.

Paul

PS- Set the Visible for the label to false. That way it wont be on the form.

Re:Minimizing an application so it shows NO forms


"Robert Leikanger Voje" <rober...@login.eunet.no> wrote:

Quote
>> it: How do I build an application that on startup minimizes itself so
>> all that is visible is an icon on the Taskbar.
>Try to call ShowWindow with Application.Handle, NOT MainWindow.Handle.

Wouldn't it just be easier to call the forms Hide method?

Other Threads