Thema: Delphi Looking 4 help

Einzelnen Beitrag anzeigen

jbg

Registriert seit: 12. Jun 2002
3.483 Beiträge
 
Delphi 10.1 Berlin Professional
 
#9
  Alt 27. Feb 2003, 20:00
Zitat:
EnumWin:
Delphi-Quellcode:
  if szClass = 'Notepadthen
  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.
  Mit Zitat antworten Zitat