![]() |
Re: TrayIcon zur Laufzeit aktualisieren
Zitat:
das ist ein Auszug aus einer funktionierenden Systray-Klasse, aber Achtung, bei mir stehen in TBIconList schon HIcon Handles, keine TIcons!
Delphi-Quellcode:
Gruss Reinhard
procedure TRKSystray.TaskBarAnimateIcon (TB : integer);
begin IconAnimateTime := TB; CurrentIcon := 1; Anim_Timer.Interval := IconAnimateTime; if IconVisible then Anim_Timer.Enabled := true; end; procedure TRKSystray.Timer (Sender : TObject); var NextIcon : HIcon; begin if not IconVisible then exit; CurrentIcon := CurrentIcon + 1; NextIcon := TBIconList[CurrentIcon]; if NextIcon = 0 then begin CurrentIcon := 1; NextIcon := TBIconList[CurrentIcon]; end; SetupTNID (0, NextIcon, ''); Shell_NotifyIcon (NIM_MODIFY, @tnid); end; procedure TRKSystray.SetupTNID (NMsg : integer; I : HIcon; T : ShortString); var Flags : integer; begin FillChar (tnid,sizeof(TNOTIFYICONDATA),0); tnid.cbSize := sizeof(TNOTIFYICONDATA); tnid.Wnd := Parent.Handle; tnid.uID := 121; Flags := 0; if NMsg > 0 then begin Flags := Flags + NIF_MESSAGE; tnid.uCallbackMessage := WM_TASKBAREVENT; end; if I > 0 then begin Flags := Flags + NIF_ICON; tnid.hIcon := I; end; if Length (T) > 0 then begin Flags := Flags + NIF_TIP; StrPLCopy (tnid.szTip, SystrayTextBuffer, 63); end; tnid.uFlags := Flags; end; |
Alle Zeitangaben in WEZ +1. Es ist jetzt 11:38 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