Autor Beitrag
Knotti2012
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 40

Win98, Win 2000, Win XP
D7 Enterp., D8 Demo
BeitragVerfasst: Sa 01.05.04 18:11 
Geht das das mann wenn ich auf minimieren drücke das programm mit seinen icon in die systray verschwindet udn wenn ja wie
toms
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1099
Erhaltene Danke: 2



BeitragVerfasst: Sa 01.05.04 18:20 
Hi,

Suche mal hier:

Suche in: Delphi-Forum, Delphi-Library TRAYICON

Suche bei Google TRAYICON DELPHI
StefanH
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1144

Win XP
D5 Standard, D7 Pers, D2005 Pers
BeitragVerfasst: Sa 01.05.04 18:22 
Suche in: Delphi-Forum, Delphi-Library TRAY

such dir was raus :roll:

_________________
"Als es noch keine Computer gab, war das Programmieren noch relativ einfach."(Edsger W. Dijkstra)
"Ich bin nicht von Sinnen, sondern ich rede wahre und vernünftige Worte." (Paulus)
Knotti2012 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 40

Win98, Win 2000, Win XP
D7 Enterp., D8 Demo
BeitragVerfasst: Sa 01.05.04 19:06 
mhh ja habe das gefunden:

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:
type 
  TForm1 = class(TForm) 
    procedure FormCreate(Sender: TObject); 
    procedure FormDestroy(Sender: TObject); 
  private 
    procedure MinimizeToTNA(Sender: TObject); 
  public 
  protected 
    procedure WndProc(var Message: TMessage); override; 
  end; 

var 
  Form1: TForm1; 

implementation 

{$R *.DFM} 

uses 
  ShellAPI; 

const 
  WM_TRAYMSG = WM_USER + 10; 
var 
  NID : TNotifyIconData = ( 
    cbsize           : sizeof(TNotifyIconData); 
    uID              : 0; 
    uFlags           : NIF_MESSAGE or NIF_ICON or NIF_TIP; 
    uCallbackMessage : WM_TRAYMSG; 
    szTip            : 'Beispiel'; 
  ); 


procedure TForm1.FormCreate(Sender: TObject); 
begin 
  // die noch notwendigen Zuordnungen 
  NID.Wnd := self.Handle; 
  NID.hIcon := Application.Icon.Handle; 

  // "OnMinimize"-Event ändern 
  Application.OnMinimize := MinimizeToTNA; 
end; 

procedure TForm1.FormDestroy(Sender: TObject); 
begin 
  // nur zur Sicherheit 
  Shell_NotifyIcon(NIM_DELETE,@NID); 
end; 

procedure TForm1.MinimizeToTNA(Sender: TObject); 
begin 
  // wenn das TNA-Symbol ezeugt werden konnte, ... 
  if(Shell_NotifyIcon(NIM_ADD,@NID)) then 
  // ... dann weg mit dem Taskbar-Button 
    ShowWindow(Application.Handle,SW_HIDE); 
end; 

procedure TForm1.WndProc(var Message: TMessage); 
begin 
  case Message.Msg of 
    WM_TRAYMSG: 
      case Message.lParam of 
        WM_LBUTTONDBLCLK: 
          begin 
            // weg mit dem TNA-Symbol! 
            Shell_NotifyIcon(NIM_DELETE,@NID); 
            // den Taskbar-Button wieder anzeigen 
            // (egal, wie der Status von "Shell_NotifyIcon" ist) 
            ShowWindow(Application.Handle,SW_SHOW); 
            // und das hier auch noch, um die Anwendung 
            // zu aktivieren und ggf. in den Vordergrund 
            // zu holen 
            Application.Restore; 
          end; 
      end; 
    else 
      inherited WndProc(Message); 
  end; 
end;


aber wie binde ich das in den code

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:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
unit Chatmain;

interface

uses
  Classes, QControls, QStdCtrls, QExtCtrls, QButtons, QForms, Sockets,
  QMenus, QTypes, QGraphics, ShellAPI;


type
  TForm1 = class(TForm)
    memRecv: TMemo;
    Panel1: TPanel;
    memSend: TMemo;
    Panel2: TPanel;
    btnSend: TButton;
    Panel3: TPanel;
    Label1: TLabel;
    Label2: TLabel;
    edtRemotePort: TEdit;
    Label3: TLabel;
    edtLocalPort: TEdit;
    btnActivateServer: TButton;
    TcpClient1: TTcpClient;
    TcpServer1: TTcpServer;
    MainMenu1: TMainMenu;
    Datei1: TMenuItem;
    Hilfe1: TMenuItem;
    Ende1: TMenuItem;
    ber1: TMenuItem;
    Label4: TLabel;
    Image1: TImage;
    ber2: TMenuItem;
    Label5: TLabel;
    Label6: TLabel;
    edtRemoteHost: TComboBox;
    Image2: TImage;
    Image3: TImage;
    procedure btnSendClick(Sender: TObject);
    procedure TcpServer1Accept(sender: TObject;
      ClientSocket: TCustomIpClient);
    procedure btnActivateServerClick(Sender: TObject);
    procedure Ende1Click(Sender: TObject);
    procedure ber1Click(Sender: TObject);
  private
    procedure MinimizeToTNA(Sender: TObject);
  public
  protected 
    procedure WndProc(var Message: TMessage); override;
  end;

  // you must create your own thread to synch
  // writing to a gui component
  TClientDataThread = class(TThread)
  private
  public
    ListBuffer :TStringList;
    TargetList :TStrings;
    procedure synchAddDataToControl;
    constructor Create(CreateSuspended: Boolean);
    procedure Execute; override;
    procedure Terminate;
  end;

var
  Form1: TForm1;
  //DataThread: TClientDataThread;

implementation

uses aboutb;
{$R *.xfm}

//------------- TClientDataThread impl -----------------------------------------
constructor TClientDataThread.Create(CreateSuspended: Boolean);
begin
  inherited Create(CreateSuspended);
  FreeOnTerminate := true;
  ListBuffer := TStringList.Create;
end;

procedure TClientDataThread.Terminate;
begin
  ListBuffer.Free;
  inherited;
end;

procedure TClientDataThread.Execute;
begin
  Synchronize(synchAddDataToControl);
end;

procedure TClientDataThread.synchAddDataToControl;
begin
 TargetList.AddStrings(ListBuffer);
end;
//------------- end TClientDataThread impl -------------------------------------


procedure TForm1.btnActivateServerClick(Sender: TObject);
begin
  TcpServer1.LocalPort := edtLocalPort.Text;
  TcpServer1.Active := True;
end;         

procedure TForm1.btnSendClick(Sender: TObject);
var
  I: Integer;
begin
  TcpClient1.RemoteHost := edtRemoteHost.Text;
  TcpClient1.RemotePort := edtRemotePort.Text;
  try
    if TcpClient1.Connect then
      for I := 0 to memSend.Lines.Count - 1 do
      TcpClient1.Sendln(memSend.Lines[I]);
  finally
    TcpClient1.Disconnect;

  end;
  memSend.Clear
  end;

procedure TForm1.TcpServer1Accept(sender: TObject;
  ClientSocket: TCustomIpClient);
var
  s: string;
  DataThread: TClientDataThread;
begin
  // create thread
  DataThread:= TClientDataThread.Create(true);
  // set the TagetList to the gui list that you
  // with to synch with.
  DataThread.TargetList := memRecv.lines;

  // Load the Threads ListBuffer
  DataThread.ListBuffer.Add('*** Connection Accepted ***');
  DataThread.ListBuffer.Add('Remote Host: ' + ClientSocket.LookupHostName(ClientSocket.RemoteHost) +
   ' (' + ClientSocket.RemoteHost + ')');
  DataThread.ListBuffer.Add('===== Begin message =====');
  s := ClientSocket.Receiveln;
  while s <> '' do
  begin
    DataThread.ListBuffer.Add(s);
    s := ClientSocket.Receiveln;
  end;
  DataThread.ListBuffer.Add('===== End of message =====');

  // Call Resume which will execute and synch the
  // ListBuffer with the TargetList
  DataThread.Resume;

end;

procedure TForm1.Ende1Click(Sender: TObject);
begin
  Close;
end;

procedure TForm1.ber1Click(Sender: TObject);
begin
  about.show;
end;
end.


ein gönnte mir jemadn den vollständigen code it einbindung schicken



Moderiert von user profile icontommie-lie: Quote- durch Delphi-Tags ersetzt
bms
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 735

Win XP
Delphi 3, Delphi 6 PE, Delphi 2005 PE
BeitragVerfasst: Sa 01.05.04 19:11 
Nein. Soll ich mir die Arbeit machen und den unleselichen Code von dir angucken? Wie wäre es wenn du auf EDIT klickst und den QUOTE Tag gegen DELPHI Tag austausch. Dann könnte man sich wenigstens ansehen was du da gepostet hast.

Das wirst du wohl noch hinkriegen. Du hast schließlich Delphi 7 Enterprise.

_________________
VORSICHT: Ich behersche seit heute die Fünf-Finger-Handflächen-Herz-Explodier-Schlag-Kampf-Technik >:(
StefanH
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1144

Win XP
D5 Standard, D7 Pers, D2005 Pers
BeitragVerfasst: Sa 01.05.04 19:11 
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:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
194:
195:
196:
197:
198:
199:
200:
201:
202:
203:
204:
205:
206:
207:
208:
209:
210:
211:
212:
213:
214:
215:
216:
217:
218:
219:
220:
221:
222:
223:
unit Chatmain; 

interface 

uses 
Classes, QControls, QStdCtrls, QExtCtrls, QButtons, QForms, Sockets, 
QMenus, QTypes, QGraphics, ShellAPI; 


type 
TForm1 = class(TForm) 
memRecv: TMemo; 
Panel1: TPanel; 
memSend: TMemo; 
Panel2: TPanel; 
btnSend: TButton; 
Panel3: TPanel; 
Label1: TLabel; 
Label2: TLabel; 
edtRemotePort: TEdit; 
Label3: TLabel; 
edtLocalPort: TEdit; 
btnActivateServer: TButton; 
TcpClient1: TTcpClient; 
TcpServer1: TTcpServer; 
MainMenu1: TMainMenu; 
Datei1: TMenuItem; 
Hilfe1: TMenuItem; 
Ende1: TMenuItem; 
ber1: TMenuItem; 
Label4: TLabel; 
Image1: TImage; 
ber2: TMenuItem; 
Label5: TLabel; 
Label6: TLabel; 
edtRemoteHost: TComboBox; 
Image2: TImage; 
Image3: TImage; 
procedure btnSendClick(Sender: TObject); 
procedure TcpServer1Accept(sender: TObject; 
ClientSocket: TCustomIpClient); 
procedure btnActivateServerClick(Sender: TObject); 
procedure Ende1Click(Sender: TObject); 
procedure ber1Click(Sender: TObject);
procedure FormCreate(Sender: TObject); 
procedure FormDestroy(Sender: TObject);  
private 
procedure MinimizeToTNA(Sender: TObject); 
public 
protected 
procedure WndProc(var Message: TMessage); override; 
end; 

// you must create your own thread to synch 
// writing to a gui component 
TClientDataThread = class(TThread) 
private 
public 
ListBuffer :TStringList; 
TargetList :TStrings; 
procedure synchAddDataToControl; 
constructor Create(CreateSuspended: Boolean); 
procedure Execute; override; 
procedure Terminate; 
end; 

var 
Form1: TForm1; 
//DataThread: TClientDataThread;

const 
  WM_TRAYMSG = WM_USER + 10; 
var 
  NID : TNotifyIconData = ( 
    cbsize           : sizeof(TNotifyIconData); 
    uID              : 0; 
    uFlags           : NIF_MESSAGE or NIF_ICON or NIF_TIP; 
    uCallbackMessage : WM_TRAYMSG; 
    szTip            : 'Beispiel'; 
  ); 

implementation 

uses aboutb; 
{$R *.xfm} 

//------------- TClientDataThread impl ----------------------------------------- 
constructor TClientDataThread.Create(CreateSuspended: Boolean); 
begin 
inherited Create(CreateSuspended); 
FreeOnTerminate := true; 
ListBuffer := TStringList.Create; 
end; 

procedure TClientDataThread.Terminate; 
begin 
ListBuffer.Free; 
inherited; 
end; 

procedure TClientDataThread.Execute; 
begin 
Synchronize(synchAddDataToControl); 
end; 

procedure TClientDataThread.synchAddDataToControl; 
begin 
TargetList.AddStrings(ListBuffer); 
end; 
//------------- end TClientDataThread impl ------------------------------------- 


procedure TForm1.btnActivateServerClick(Sender: TObject); 
begin 
TcpServer1.LocalPort := edtLocalPort.Text; 
TcpServer1.Active := True; 
end; 

procedure TForm1.btnSendClick(Sender: TObject); 
var 
I: Integer; 
begin 
TcpClient1.RemoteHost := edtRemoteHost.Text; 
TcpClient1.RemotePort := edtRemotePort.Text; 
try 
if TcpClient1.Connect then 
for I := 0 to memSend.Lines.Count - 1 do 
TcpClient1.Sendln(memSend.Lines[I]); 
finally 
TcpClient1.Disconnect; 

end; 
memSend.Clear 
end; 

procedure TForm1.TcpServer1Accept(sender: TObject; 
ClientSocket: TCustomIpClient); 
var 
s: string; 
DataThread: TClientDataThread; 
begin 
// create thread 
DataThread:= TClientDataThread.Create(true); 
// set the TagetList to the gui list that you 
// with to synch with. 
DataThread.TargetList := memRecv.lines; 

// Load the Threads ListBuffer 
DataThread.ListBuffer.Add('*** Connection Accepted ***'); 
DataThread.ListBuffer.Add('Remote Host: ' + ClientSocket.LookupHostName(ClientSocket.RemoteHost) + 
' (' + ClientSocket.RemoteHost + ')'); 
DataThread.ListBuffer.Add('===== Begin message ====='); 
s := ClientSocket.Receiveln; 
while s <> '' do 
begin 
DataThread.ListBuffer.Add(s); 
s := ClientSocket.Receiveln; 
end; 
DataThread.ListBuffer.Add('===== End of message ====='); 

// Call Resume which will execute and synch the 
// ListBuffer with the TargetList 
DataThread.Resume; 

end; 

procedure TForm1.Ende1Click(Sender: TObject); 
begin 
Close; 
end; 

procedure TForm1.ber1Click(Sender: TObject); 
begin 
about.show; 
end;

procedure TForm1.FormCreate(Sender: TObject); 
begin 
  // die noch notwendigen Zuordnungen 
  NID.Wnd := self.Handle; 
  NID.hIcon := Application.Icon.Handle; 

  // "OnMinimize"-Event ändern 
  Application.OnMinimize := MinimizeToTNA; 
end; 

procedure TForm1.FormDestroy(Sender: TObject); 
begin 
  // nur zur Sicherheit 
  Shell_NotifyIcon(NIM_DELETE,@NID); 
end; 

procedure TForm1.MinimizeToTNA(Sender: TObject); 
begin 
  // wenn das TNA-Symbol ezeugt werden konnte, ... 
  if(Shell_NotifyIcon(NIM_ADD,@NID)) then 
  // ... dann weg mit dem Taskbar-Button 
    ShowWindow(Application.Handle,SW_HIDE); 
end; 

procedure TForm1.WndProc(var Message: TMessage); 
begin 
  case Message.Msg of 
    WM_TRAYMSG: 
      case Message.lParam of 
        WM_LBUTTONDBLCLK: 
          begin 
            // weg mit dem TNA-Symbol! 
            Shell_NotifyIcon(NIM_DELETE,@NID); 
            // den Taskbar-Button wieder anzeigen 
            // (egal, wie der Status von "Shell_NotifyIcon" ist) 
            ShowWindow(Application.Handle,SW_SHOW); 
            // und das hier auch noch, um die Anwendung 
            // zu aktivieren und ggf. in den Vordergrund 
            // zu holen 
            Application.Restore; 
          end; 
      end; 
    else 
      inherited WndProc(Message); 
  end; 

end.


so in etwa??

_________________
"Als es noch keine Computer gab, war das Programmieren noch relativ einfach."(Edsger W. Dijkstra)
"Ich bin nicht von Sinnen, sondern ich rede wahre und vernünftige Worte." (Paulus)
Knotti2012 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 40

Win98, Win 2000, Win XP
D7 Enterp., D8 Demo
BeitragVerfasst: Sa 01.05.04 19:28 
entschuldige iuch bin neu im forum werde es beachten
Knotti2012 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 40

Win98, Win 2000, Win XP
D7 Enterp., D8 Demo
BeitragVerfasst: Sa 01.05.04 19:29 
nee ghet nicht


ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
Erzeugen
  [Fehler] Chatmain.pas(51): Methode 'WndProc' nicht in Basisklasse gefunden
  [Fehler] Chatmain.pas(72): Undefinierter Bezeichner: 'WM_USER'
  [Fehler] Chatmain.pas(72): Konstantenausdruck erwartet
  [Fehler] Chatmain.pas(180): Inkompatible Typen: 'HWND' und 'QOpenScrollViewH'
  [Fehler] Chatmain.pas(181): Inkompatible Typen: 'HICON' und 'QPixmapH'
  [Fehler] Chatmain.pas(198): Undefinierter Bezeichner: 'ShowWindow'
  [Fehler] Chatmain.pas(198): Undefinierter Bezeichner: 'SW_HIDE'
  [Fehler] Chatmain.pas(205): Undefinierter Bezeichner: 'lParam'
  [Fehler] Chatmain.pas(206): Undefinierter Bezeichner: 'WM_LBUTTONDBLCLK'
  [Fehler] Chatmain.pas(212): Undefinierter Bezeichner: 'ShowWindow'
  [Fehler] Chatmain.pas(212): Undefinierter Bezeichner: 'SW_SHOW'
  [Fehler] Chatmain.pas(220): Undefinierter Bezeichner: 'WndProc'
  [Fehler] Chatmain.pas(223): ';' erwartet, aber '.' gefunden
  [Fataler Fehler] NetChat.dpr(6): Verwendete Unit 'Chatmain.pas' kann nicht compiliert werden
Michael Stenzel
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 133


D3 Prof, D7 PE
BeitragVerfasst: So 02.05.04 03:42 
Hi Knotti2012!

Binde diese Unit bei Dir ein.
Bei der Typedeklaration von TForm1 leites Du dein Formular von TFormTB ab.

ausblenden Delphi-Quelltext
1:
2:
  type TForm1 = class(TFormTB)
  ...


Wenn Du dann deine Anwendung ins Tray schicken willst, dann brauchst Du nur die Prozedur MiniToTB aufzurufen.

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:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
unit TBForm;

interface

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

const
  US_TaskBar  = WM_User + 1;

type
  TFormTB = class(TForm)
  private
    { Private declarations }
    DelIconToMax : boolean;
    procedure USTaskBar(var Message: TMessage);
      message US_TaskBar;
  public
    { Public declarations }
    // Minimiert die Anwendung nur zum Tray-Icon, Applications-Fenster verborgen
    procedure MiniToTB(HinweisText:String; DelIcon : boolean);

    // Setzt das Applications-Icon im Tray, Applications-Fenster bleibt
    procedure IconToTB(HinweisText:String; DelIcon : boolean);

    // Löscht das Icon aus dem Tray
    procedure DeleteTB;

    // Veändert den Hinweistext vom Tray-Icon
    procedure HinweisChange(Hinweis:string);

    // Applications-Fenster Verbergen
    procedure HideApp;
  end;

implementation

uses ShellAPI;

const
  TBId = 1;

procedure TFormTB.HideApp;
begin
  Hide;
  ShowWindow(Application.Handle, SW_Hide);
end;

procedure TFormTB.MiniToTB(Hinweistext : String; DelIcon : boolean);
var
  aNID : TNotifyIconData;
begin
  DelIconToMax := DelIcon;
  aNID.cbSize := SizeOf(TNotifyIconData);
  aNID.Wnd := Handle;
  aNID.uID := TBId;
  aNID.uFlags := NIF_MESSAGE or NIF_ICON or NIF_TIP;
  aNID.uCallBackMessage := US_TaskBar;
  aNID.hIcon := Application.Icon.Handle;
  StrLCopy(aNID.szTip,PChar(HinweisText),63);
  Shell_NotifyIcon(NIM_ADD, @aNID);
  HideApp;
end;

procedure TFormTB.IconToTB(Hinweistext : String; DelIcon : boolean);
var
  aNID : TNotifyIconData;
begin
  DelIconToMax := DelIcon;
  aNID.cbSize := SizeOf(TNotifyIconData);
  aNID.Wnd := Handle;
  aNID.uID := TBId;
  aNID.uFlags := NIF_MESSAGE or NIF_ICON or NIF_TIP;
  aNID.uCallBackMessage := US_TaskBar;
  aNID.hIcon := Application.Icon.Handle;
  StrLCopy(aNID.szTip,PChar(HinweisText),63);
  Shell_NotifyIcon(NIM_ADD, @aNID);
end;

procedure TFormTB.DeleteTB;
var
  aNID : TNotifyIconData;
begin
  aNID.cbSize := SizeOf(TNotifyIconData);
  aNID.Wnd := Handle;
  aNID.uID := TBId;
  Shell_NotifyIcon(NIM_DELETE, @aNID);
end;


procedure TFormTB.HinweisChange(Hinweis:String);
var
  aNID : TNotifyIconData;
begin
  aNID.cbSize := SizeOf(TNotifyIconData);
  aNID.Wnd := Handle;
  aNID.uID := TBId;
  aNID.uFlags := NIF_MESSAGE or NIF_ICON or NIF_TIP;
  aNID.uCallBackMessage := US_TaskBar;
  aNID.hIcon := Application.Icon.Handle;
  StrLCopy(aNID.szTip,PChar(Hinweis),63);
  Shell_NotifyIcon(NIM_MODIFY, @aNID);
end;

procedure TFormTB.USTaskBar(var Message: TMessage);
begin
  if Message.lParam = WM_LButtonDown then begin
    Show;
    If DelIconToMax then DeleteTB;
  end;
end;

end.


mfg
Michael.