![]() |
Systemtray ersetzen
Hallo,
ich suche eine Möglichkeit, die Symbole im Systemtray in einer eigenen Anwendung anzeigen zu lassen. Das Ziel der ganzen Aktion: Ich möchte statt des Windows - Explorers eine eigene Anwendung als Desktopumgebung einsetzen. Wenn ich nun aber in der Registry die entsprechenden Einträge ändere und meine Anwendung gestartet wird fliegen alle Fenster von Norton,... die sonst im Tray verschwanden auf dem Desktop herum. Ich suche nach einer Möglichkeit, auf die funktion Shell_NotifyIcon reagieren zu können. Was mir dazu einfällt wäre ein Hook auf diese Funktion. Ich habe allerdings keine Ahnung wie das geht. Bin für jede Idee, jeden Denkanstoß, Lösungsansatz, ... dankbar. gruß Helen |
Re: Systemtray ersetzen
|
Re: Systemtray ersetzen
Ich möchte nicht kleinlich sein, aber das wort 'Tray' ist ne art missverständniss ... soweit ich das weis heißt das ganze TaskBar Notification Area kurz TBNA ... :lol:
PS: Nimms nicht persönlich ;) ciao, Philipp |
Re: Systemtray ersetzen
Ich habe folgende Sourcen gebastelt, aber nix passiert:
Hook - dll
Code:
Programm unit
library TBNAhook;
uses Windows, madRemote, madCodeHook, madStrings, ShellAPI, dialogs; var Shell_NotifyIcon : function (dwMessage: DWORD; lpData: PNotifyIconData) : bool; stdcall; var Shell_NotifyIconA : function (dwMessage: DWORD; lpData: PNotifyIconData) : bool; stdcall; var Shell_NotifyIconW : function (dwMessage: DWORD; lpData: PNotifyIconData) : bool; stdcall; function MY_NotifyIcon (dwMessage: DWORD; lpData: PNotifyIconData): BOOL; stdcall; begin ShowMessage (lpData.szTip); result := true; end; function MY_NotifyIconA (dwMessage: DWORD; lpData: PNotifyIconData): BOOL; stdcall; begin ShowMessage (lpData.szTip); result := true; end; function MY_NotifyIconW (dwMessage: DWORD; lpData: PNotifyIconData): BOOL; stdcall; begin ShowMessage (lpData.szTip); result := true; end; begin HookAPI('shell32.dll', 'Shell_NotifyIcon', @MY_NotifyIcon, @Shell_NotifyIcon); HookAPI('shell32.dll', 'Shell_NotifyIconA', @MY_NotifyIconA, @Shell_NotifyIconA); HookAPI('shell32.dll', 'Shell_NotifyIconW', @MY_NotifyIconW, @Shell_NotifyIconW); end.
Code:
unit Testmain;
interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, madCodeHook; type TForm1 = class(TForm) private { Private-Deklarationen } public { Public-Deklarationen } end; var Form1: TForm1; implementation {$R *.dfm} begin InjectLibrary(ALL_SESSIONS or SYSTEM_PROCESSES, 'TBNAhook.dll'); UninjectLibrary(ALL_SESSIONS or SYSTEM_PROCESSES, 'TBNAhook.dll'); end. Wo steckt der Fehler? |
Re: Systemtray ersetzen
Ich habe es jetzt mit ein wenig Bastelei geschafft, das die Orginalfunktion durch meine eigene ersetzt wird.
Wie kann ich nun auf die Daten, die im Object PNotifyIconData gespeichert sind zugreifen, und das Bild und die Ballontipps, etc in meiner Anwendung darstellen? |
Re: Systemtray ersetzen
Wenn´s nicht in der Art funktioniert wie hier
Zitat:
Delphi-Quellcode:
o.ä. (denn PNotifyIconData ist ja IMHO nur ein Zeiger auf das TNotifyIconData-Record), dann ist es wohl doch komplizierter als du denkst. Und die Balloon-Tipps müsstest du wohl selbst darstellen, denn a) setzen die eine bestimmte "shell32.dll"-Version voraus (5.0 aufwärts), und b) möchtest du ja nichts vom System nutzen.
PNotifyIconData(lpData)^.szTip
|
Re: Systemtray ersetzen
In meinem letzten Beitrag habe ich mich blöd ausgedrückt... I'm sorry!
Ich habe eine Anwendung Leiste, die ein Formular Form1 anzeigt. Die Hook.dll wurde nun korrekt eingerichtet, und die in dieser dll enthaltene funktion Shell_NotifyIcon soll jetzt das Icon, welches ihr übergeben wurde auf dem TPanel Panel1 auf dem Formular Form1 der Anwendung Leiste ablegen. Wie bekomme ich dies hin? |
Alle Zeitangaben in WEZ +1. Es ist jetzt 20:33 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