![]() |
TJvTrayIcon aktualisieren
Bisheriger Code:
Delphi-Quellcode:
Im Entwicklungsmodus funktioniert das aktualisieren des Icons, aber während der Laufzeit nicht. Es wäre ja theoretisch einfach ShellNotifyIcon aber wie setze ich das ein bzw. was mache ich falsch ;)
if (bActive) then
Tray.IconIndex := 0 else Tray.IconIndex := 1; |
Re: TJvTrayIcon aktualisieren
Probier mal ein Sendmessage mit WM_PAINT :gruebel:
|
Re: TJvTrayIcon aktualisieren
Hier noch ein Auszug aus dem Quellcode:
1. Schritt
Delphi-Quellcode:
2. Schritt
procedure TJvTrayIcon.SetIconIndex(const Value: Integer);
begin if FIconIndex <> Value then begin FIconIndex := Value; IconPropertyChanged; end;
Delphi-Quellcode:
procedure TJvTrayIcon.SetCurrentIcon(Value: TIcon);
begin FCurrentIcon.Assign(Value); FIconData.hIcon := FCurrentIcon.Handle; if tisTrayIconVisible in FState then // if FIconData.hIcon = 0 then // HideTrayIcon // else NotifyIcon(NIF_ICON, NIM_MODIFY); end;
Delphi-Quellcode:
procedure TJvTrayIcon.IconPropertyChanged;
var Ico: TIcon; begin if not (csLoading in ComponentState) then begin if (FIcons <> nil) and (FIconIndex >= 0) and (FIconIndex < FIcons.Count) then begin Ico := TIcon.Create; try FIcons.GetIcon(FIconIndex, Ico); SetCurrentIcon(Ico); finally Ico.Free; end; end else if Assigned(Icon) and (not Icon.Empty) then SetCurrentIcon(Icon) else SetCurrentIcon(Application.Icon); end; end; Vielleicht sieht das ja jemand raus, weil ich sehe es nicht ;) |
Re: TJvTrayIcon aktualisieren
Ah ich bin ein Dussel... Die Bedingung war falsch
Sorry, ist schon spät ;) Kann geschlossen werden.... |
Alle Zeitangaben in WEZ +1. Es ist jetzt 01:04 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