AGB  ·  Datenschutz  ·  Impressum  







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

Systemtray ersetzen

Ein Thema von helen · begonnen am 8. Mai 2004 · letzter Beitrag vom 13. Mai 2004
Antwort Antwort
helen

Registriert seit: 8. Mai 2004
42 Beiträge
 
#1

Systemtray ersetzen

  Alt 8. Mai 2004, 17:23
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
  Mit Zitat antworten Zitat
Benutzerbild von toms
toms
(CodeLib-Manager)

Registriert seit: 10. Jun 2002
4.648 Beiträge
 
Delphi XE Professional
 
#2

Re: Systemtray ersetzen

  Alt 8. Mai 2004, 17:26
Hi,

Auf www.madshi.net findest du alles was du brauchst.
Thomas
  Mit Zitat antworten Zitat
Benutzerbild von c113plpbr
c113plpbr

Registriert seit: 18. Nov 2003
Ort: localhost
674 Beiträge
 
Delphi 2005 Professional
 
#3

Re: Systemtray ersetzen

  Alt 8. Mai 2004, 18:46
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 ...
PS: Nimms nicht persönlich

ciao, Philipp
Philipp
There is never enough time to do all the nothing you want.
*HABENWILL*
  Mit Zitat antworten Zitat
helen

Registriert seit: 8. Mai 2004
42 Beiträge
 
#4

Re: Systemtray ersetzen

  Alt 8. Mai 2004, 20:53
Ich habe folgende Sourcen gebastelt, aber nix passiert:

Hook - dll

Code:
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.
Programm unit
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?
  Mit Zitat antworten Zitat
helen

Registriert seit: 8. Mai 2004
42 Beiträge
 
#5

Re: Systemtray ersetzen

  Alt 11. Mai 2004, 21:02
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?
  Mit Zitat antworten Zitat
MathiasSimmack
(Gast)

n/a Beiträge
 
#6

Re: Systemtray ersetzen

  Alt 11. Mai 2004, 21:31
Wenn´s nicht in der Art funktioniert wie hier
Zitat von helen:
ShowMessage (lpData.szTip);
bzw.
PNotifyIconData(lpData)^.szTip 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.
  Mit Zitat antworten Zitat
helen

Registriert seit: 8. Mai 2004
42 Beiträge
 
#7

Re: Systemtray ersetzen

  Alt 13. Mai 2004, 12:28
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?
  Mit Zitat antworten Zitat
Antwort Antwort


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 07:27 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz