AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Win32/Win64 API (native code) Delphi An die Daten von PNotifyIconData herankommen
Thema durchsuchen
Ansicht
Themen-Optionen

An die Daten von PNotifyIconData herankommen

Ein Thema von helen · begonnen am 17. Mai 2004 · letzter Beitrag vom 22. Mai 2004
 
helen

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

Re: An die Daten von PNotifyIconData herankommen

  Alt 18. Mai 2004, 10:59
Hallo,

wie kann ich denn den Zeiger auf die Callback-Funktion an die DLL übermitteln?

Das installieren des Hooks funktioniert so:
Code:
procedure TForm1.Button1Click(Sender: TObject);
begin
  InjectLibrary(ALL_SESSIONS or SYSTEM_PROCESSES, 'TBNAhook.dll');
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  UninjectLibrary(ALL_SESSIONS or SYSTEM_PROCESSES, 'TBNAhook.dll');
end;
der Hook selbst sieht so aus:
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);
  //Form1.AddIcon (dwMessage, @lpData);


  result := true;
end;

function MY_NotifyIconA (dwMessage: DWORD; lpData: PNotifyIconData): BOOL; stdcall;
begin
  ShowMessage (lpData.szTip);
  //Form1.AddIcon (dwMessage, @lpData);

  result := true;
end;

function MY_NotifyIconW (dwMessage: DWORD; lpData: PNotifyIconData): BOOL; stdcall;
begin
  ShowMessage (lpData.szTip);
  //Form1.AddIcon (dwMessage, @lpData);

  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.
Ich habe nun versucht, das Icon aus PNotifyIconData mit
Code:
tmp := TIcon.Create;
tmp.Assign (lpData.hIcon);

ImageIndex := ImageList1.AddIcon (tmp);
in eine ImageList einzufügen, aber das läuft nicht...
  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 06:07 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