Hi,
bin seit mehr als 1 Woche am grübel bekomms, aber einfach net gebacken...
In der
DLL:
Delphi-Quellcode:
lpView: TDLLData;
CopyMemory(@lpView^.mouse, PMOUSEHOOKSTRUCT(lParam), sizeof(TMOUSEHOOKSTRUCT));
SendMessage(HWND_BROADCAST, lpView^.WM_MOUSEHOOKMSG, wParam, lParam);
In meinem Programm:
Delphi-Quellcode:
function InstallHooks(Hwnd: HWND): Boolean; stdcall; external 'hooks.dll' name 'InstallHooks';
function UninstallHooks: Boolean; stdcall; external 'hooks.dll' name 'UninstallHooks';
var WM_MOUSEHOOKMSG:cardinal;
InstallHooks(Application.Handle);
procedure TFormMain.GetHWNDBroadcast(var Msg: TMsg);
begin
if Msg.message = WM_MOUSEHOOKMSG then
begin
Memo1.Lines.Add(IntToStr(Msg.hwnd));
(Self.Refresh;)
end;
(inherited;)
end;
procedure TformMain.FormCreate(Sender: TObject);
begin
WM_MOUSEHOOKMSG := RegisterWindowMessage('WM_MOUSEHOOKMSG');
end;
Scheint irgendwas an der Verarbeitung von lpView zu hängen...?
Vielen Dank für alle Tipps