Zitat:
EnumWin:
Delphi-Quellcode:
if szClass = '
Notepad'
then
begin
Win := PWinInfo(GetWindowLong(
Handle, GWL_USERDATA));
{ set back ptr }
SetWindowLong(
Handle, GWL_WNDPROC, Win^.OldPtr);
{ free memory }
Dispose(Win);
end;
I see the problem within
Dispose(). Dispose uses the memory manager of the calling process. But your Hook-
Dll is executed in many processes. So what you do in this code is freeing memory not allocated by this process.