AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Programm nur im TNA anzeigen?

Ein Thema von MCXSC · begonnen am 17. Jul 2004 · letzter Beitrag vom 17. Jul 2004
 
Lefko

Registriert seit: 31. Jul 2003
359 Beiträge
 
Delphi 6 Enterprise
 
#5

Re: Programm nur im TNA anzeigen?

  Alt 17. Jul 2004, 16:52
na dazu nimmst du ein TNotifyIcon und machst das im Form.create an seinen Platz und bei Form.destroy oder wann immer du dein Programm beendest, machst du es wieder weg!

z.B. so:

Delphi-Quellcode:
procedure Taskbar_on(Icontitle : string);
procedure Taskbar_off;
procedure TaskbarEvent(var Msg: TMessage); Message WM_TASKABAREVENT;

...

procedure Taskbar_on (Icontitle : String);
var NotifyIconData: TNotifyIconData;
    a : integer;
begin
Fillchar(NotifyIconData,Sizeof(NotifyIconData),0);
   NotifyIconData.cbSize := Sizeof(NotifyIconData);
   NotifyIconData.Wnd := Handle;
   NotifyIconData.uFlags := NIF_MESSAGE or NIF_ICON or NIF_TIP;
   NotifyIconData.uCallbackMessage := WM_TASKABAREVENT;
   NotifyIconData.hIcon := Application.Icon.Handle;

   for a := 0 to 63 do
   NotifyIconData.szTip[a] := IconTitle[a+1]; //warum hab ich das denn gemacht? :gruebel:

   Shell_NotifyIcon(NIM_ADD, @NotifyIconData);
end;


procedure Taskbar_off;
var NotifyIconData : TNotifyIconData;
begin
FillChar(NotifyIconData,Sizeof(NotifyIconData),0);
   NotifyIconData.cbSize := Sizeof(NotifyIconData);
   NotifyIconData.Wnd := self.Handle;
   NotifyIconData.uFlags := NIF_MESSAGE or NIF_ICON or NIF_TIP;
   NotifyIconData.uCallbackMessage := WM_TASKABAREVENT;
   NotifyIconData.hIcon := Application.Icon.Handle;
   NotifyIconData.szTip := 'Punkt';
   Shell_NotifyIcon(NIM_DELETE, @NotifyIconData);
end;


procedure TForm1.TaskbarEvent(var Msg: TMessage);
begin
if Msg.LParam = wm_LButtonDblClk then begin
                                      Application.restore;
                                      Application.bringtofront;
                                      Form1.activate;
                                      end;

if Msg.LParam = wm_RButtonDown then popupmenu1.popup(Mouse.CursorPos.X,Mouse.CursorPos.Y);
end;
(Also so hab ich es mal gemacht, ist also nur ein Beispiel....)

MfG Lefko
Johannes
-=[Nennst du meinen Namen, bin ich schon nicht mehr da]=-
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 13:50 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz