Autor Beitrag
Luzifer666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 41

Win XP
D6 Personal, D7 Personal
BeitragVerfasst: Sa 13.03.04 22:42 
Hei

Ich möchte gerne, dass sich mein Prog bei klick auf nen Button schliesst und in die Symbolleiste verschiebt (wobei es bei klick auf das Symbol in der Symbolleiste wieder erneut kommt).
Hat wer nen Tipp?

_________________
I can see unknown errors. 8[
Cya & enjoy!
tmc2004
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 140

zuviele
D7,D8
BeitragVerfasst: Sa 13.03.04 22:59 
Ich hab da folgenden code mal gefunden der könnte dir weiterhelfen.

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
unit tray; 

interface 

uses
shellapi,Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;

const
WM_TRAYEVENT = WM_USER+100; 

type
TForm1 = class(TForm)
Button1: TButton;
procedure FormCreate(Sender: TObject);  // im Objektinspektor eintragen
procedure FormDestroy(Sender: TObject); // im Objektinspektor eintragen
private
procedure OnMinimize(Sender: Tobject);
procedure OnDeactivate(Sender: Tobject);
procedure TrayEvent(var Msg: TMessage); Message WM_TRAYEVENT;
public
{ Public-Deklarationen}
end; 

var
Form1: TForm1;
NotifyIconData: TNotifyIconData; 

implementation 

{$R *.DFM} 

procedure rein;
begin
Shell_NotifyIcon(NIM_ADD, @NotifyIconData);
end; 

procedure raus;
begin
Shell_NotifyIcon(NIM_DELETE, @NotifyIconData);
end; 

procedure TForm1.OnMinimize(sender:tobject);
begin
showwindow(application.handle,sw_hide);
rein;
end; 

procedure TForm1.TrayEvent(var Msg: TMessage);
begin
if msg.lparam = WM_LButtonDown then begin
showwindow(application.handle,sw_showminimized);
raus;
showwindow(application.handle,sw_shownormal);
form1.Show;
end;
end; 

procedure TForm1.FormCreate(Sender: TObject);
begin
Application.OnMinimize:=OnMinimize;
Application.OnDeactivate:=OnDeactivate;
NotifyIconData.cbSize := Sizeof(NotifyIconData);
NotifyIconData.Wnd := Handle;
NotifyIconData.uFlags := NIF_MESSAGE or NIF_ICON or NIF_TIP;
NotifyIconData.uCallbackMessage := WM_TRAYEVENT;
NotifyIconData.hIcon := Application.Icon.Handle;
NotifyIconData.szTip := 'Klicken Sie mit der linken Maustaste'+#0;
end; 

procedure TForm1.FormDestroy(Sender: TObject);
begin
raus;
end; 

procedure TForm1.onDeactivate(Sender: TObject);
begin
form1.Visible:=false;
onminimize(sender);
end; 

end.


Gruß tmc :oops:

_________________
it's not a bug it's a feature
Luzifer666 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 41

Win XP
D6 Personal, D7 Personal
BeitragVerfasst: Sa 13.03.04 23:15 
Danke! :D

Na, das ist ja schonmal sehr konkret!

Nur ich check noch net so ganz was da genau abläuft wenn die form created/minimiert wird... :/

_________________
I can see unknown errors. 8[
Cya & enjoy!
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: So 14.03.04 10:50 
oder die cooltray komponenten. einfach mal in google nach cooltray suchen

_________________
In the beginning was the word.
And the word was content-type: text/plain.
Luzifer666 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 41

Win XP
D6 Personal, D7 Personal
BeitragVerfasst: So 14.03.04 11:19 
Vielen Dank, ist genau das was ich gesucht hab! :D

Für alle anderen Interessierten:
Die Komponenten + Beispielprog findet ihr unter www.torry.net/vcl/sy...ayicons/trayicon.zip !

Gruss

_________________
I can see unknown errors. 8[
Cya & enjoy!
NetZwerg
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 448

Slackware 10.1
Kylix 3, D5 Standard
BeitragVerfasst: So 14.03.04 11:24 
Is ja hart! Man, ich hätte nie gedacht das delphi so flexibel ist.... :roll:

_________________
"Manche Leute drücken nur deshalb ein Auge zu, damit sie besser zielen können."
Billy Wilder, amer. Filmregisseur
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: So 14.03.04 13:32 
NetZwerg hat folgendes geschrieben:
Is ja hart! Man, ich hätte nie gedacht das delphi so flexibel ist.... :roll:

was dachtest du denn ?? dass delphi nur buttons kann und sonst nic oder was ?

_________________
In the beginning was the word.
And the word was content-type: text/plain.
Luzifer666 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 41

Win XP
D6 Personal, D7 Personal
BeitragVerfasst: So 14.03.04 13:34 
Delphi kann so ziemlich alles!

(eigene) Komponenten > all ;)

_________________
I can see unknown errors. 8[
Cya & enjoy!