procedure:
Delphi-Quellcode:
procedure NotepadDestroyed(
Handle: HWND);
var
Win: PWinInfo;
begin
Win := PWinInfo(GetWindowLong(
Handle, GWL_USERDATA));
{ set oldptr back}
SetWindowLong(
Handle, GWL_WNDPROC, Win^.OldPtr);
{ free memory pointer}
Dispose(Win);
end;
Does Win^.OldPtr really have a valid value? Try this:
Win^.OldPtr := PWinInfo(GetWindowLong(Handle, GWL_USERDATA));