Autor Beitrag
Jojojoxx
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 386



BeitragVerfasst: So 30.07.06 14:43 
Hallo!

Ich nutze CooltrayIcon und möchte, dass meine Anwendung minimiert im Tray startet.
Ich habe den Code "Application.minimize;" in "OnFormCreate" gesetzt, allerdings wird das Fenster so nur normal minimiert und nicht ins Tray. Wenn ich "Application.minimize" allerdings hinter einen Button setze (Also wenn die Form schon erstellt und gezeigt wurde) wird die Form korrekt ins Tray minimiert.
In OnShow lässt sich "Application.Minimize" nicht ausführen.

Wie kann ich dieses Problem beheben?
Danke euch!

mfg

Jojo
Wollaston
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 27



BeitragVerfasst: Mi 02.08.06 11:49 
Hallo Jojojoxx,

setz mal die CoolTrayIcon-Property MinimizeToTray auf TRUE, dann wird Deine Applikation automatisch im Tray gestartet.

Und wenn Du im OnClick vom CoolTrayIcon noch das hier einbaust, dann wird das gute Stück richtig gut ;-) und öffnet und schließt bei jedem Klick auf das TrayIcon.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
procedure TForm1.CoolTrayIcon1Click(Sender: TObject);
begin
  if not Form1.Visible then
  begin
    CoolTrayIcon1.ShowMainForm;
  end
  else
  begin
    Application.Minimize;
  end;
  CoolTrayIcon1.HideTaskbarIcon;
end;
Jojojoxx Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 386



BeitragVerfasst: Mi 02.08.06 13:13 
Hi!

Das funktioniert bei mir ja bereits. Ich habe ja auch keine Probleme mit minimize wenn das Programm geladen ist.
MinimizeToTray ist auf "True" gesetzt. Es gibt nur die Probleme, wenn ich das Proramm minimiert starten will.

mfg

Jojo
Wollaston
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 27



BeitragVerfasst: Fr 04.08.06 13:28 
Sorry,

dann versuch doch mal im OnStartUp-Event vom CoolTryIcon


ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
procedure TForm1.CoolTrayIcon1Startup(Sender: TObject;
  var ShowMainForm: Boolean);
begin
  ShowMainForm  := false;
end;


Bis denn,

Wollaston