library Skin;uses
  SysUtils,
  Classes,
  Dialogs,
  controls,
  Forms,
  Windows,
  Messages;var
  OldWndProc: Pointer;function NewWndProc(hHwnd, Msg, wParam, lParam: LongWORD): Longint; stdcall;
begin
  if Msg=WM_CLOSE then begin
    ShowMessage('ok');
  end;;
  Result := CallWindowProc(OldWndProc, hHwnd, Msg, wParam, lParam);
end;function InitializeSkin(aControl: TControl): integer; stdcall;
begin  TForm(aControl).Caption := 'Robert Lee';  OldWndProc := Pointer(GetWindowLong(TForm(aControl).Handle, GWL_WNDPROC));
  setWindowLong(TForm(aControl).Handle, GWL_WNDPROC, Longint(@NewWndProc));
end;{$R *.RES}exports
  InitializeSkin;beginend.在主程序中调用InitializeSkin传来一个一个Form,为什么执行到  setWindowLong(TForm(aControl).Handle, GWL_WNDPROC, Longint(@NewWndProc));
这一句就出错呢?