Autor Beitrag
Ironwulf
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 733
Erhaltene Danke: 2



BeitragVerfasst: Fr 20.01.06 20:25 
wenn ich mein prog in den tNA (symbol neben der uhr) verschiebe, das dann öffne, funktioniert das genau einmal, also wenn ich es dann wieder in den tna schieben will zeigt es mir nur noch das symbol im tray an was ich dann aber nicht mehr öffnen kann
hier ein wenig 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:
procedure TaskBarAddIcon; //in tna verschieben
var
  tnid: TNotifyIconData;
  Owner: HWnd;
begin
  with tnid do
  begin
    cbSize := SizeOf(TNotifyIconData);
    Wnd := Form1.Handle;
    uID := 1;
    uFlags := NIF_MESSAGE or NIF_ICON or NIF_TIP;
    uCallbackMessage := WM_TASKBAREVENT;
    hIcon := Application.Icon.Handle;
  end;
  StrCopy(tnid.szTip, 'Tooltipp');
  Shell_NotifyIcon(NIM_ADD, @tnid);

  Owner:=GetWindow(Form1.Handle,GW_OWNER);
  If Owner<>0 Then
    ShowWindow(Owner,SW_HIDE);
end;

procedure TaskBarRemoveIcon; //aus tna holen, wird eigentlich nicht verwendet ist trotzdem einfach da XD
var
  tnid: TNotifyIconData;
  Owner: HWnd;
begin
  tnid.cbSize := SizeOf(TNotifyIconData);
  tnid.Wnd := Form1.Handle;
  tnid.uID := 1;
  Shell_NotifyIcon(NIM_DELETE, @tnid);
  Owner:=GetWindow(Form1.Handle,GW_OWNER);
  If Owner<>0 Then Begin
    ShowWindow(Owner,SW_Show);
    ShowWindow(Owner,SW_Normal);
  End;
end;

procedure TForm1.WMTaskbarEvent(var Message: TMessage); //wenn auf tray icon geklickt wird
var 
  Point: TPoint;
begin
  case Message.LParamLo of
     WM_LBUTTONDOWN: ;//TaskBarRemoveIcon;
     WM_RBUTTONDOWN: begin
                       SetForegroundWindow(Handle);
                       GetCursorPos(point);
                       popupmenu1.popup(point.x,point.y);
                     end;
  end;
end;

procedure TForm1.AppMinimize(Sender: TObject); //Minimieren
begin
  Form1.Hide;
end;


hoffe mir kann jemand helfen
Martin1966
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1068

Win 2000, Win XP
Delphi 7, Delphi 2005
BeitragVerfasst: Mi 25.01.06 10:50 
Hallo!

Ich kann mit den Codeausschnitten nicht wirklich ein Fehler finden. Entweder du postetst alles oder du suchst mal nach der TCoolTray Komponente. Die macht das alles schon von Hause aus.

Lg Martin

_________________
Ein Nutzer der Ecke ;-)