thanks

解决方案 »

  1.   


    ...
        ImgMain: TImage;
      private
        FClientInstance : TFarProc;
        FPrevClientProc : TFarProc;
        procedure ClientWndProc(var message:TMessage);
    ...procedure TForm1.ClientWndProc(var message: TMessage);
    var
      Dc : hDC;
      Row : Integer;
      Col : Integer;
    begin
      with Message do
        case Msg of
          WM_ERASEBKGND:
          begin
            Dc := TWMEraseBkGnd(Message).Dc;
            for Row := 0 to ClientHeight div ImgMain.Picture.Height do
              for Col := 0 to ClientWidth div ImgMain.Picture.Width do
                BitBlt(Dc,
                   Col * ImgMain.Picture.Width,
                   Row * ImgMain.Picture.Height,
                   ImgMain.Picture.Width,
                   ImgMain.Picture.Height,
                   ImgMain.Picture.Bitmap.Canvas.Handle,
                   0,
                   0,
                   SRCCOPY);
              Result := 1;
          end;
          else
            Result := CallWindowProc(FPrevClientProc,
                                     ClientHandle,
                                     Msg,
                                     wParam,
                                     lParam);
      end;
    end;procedure TForm1.FormCreate(Sender: TObject);
    begin   FClientInstance := MakeObjectInstance(ClientWndProc);
       FPrevClientProc := Pointer(GetWindowLong(ClientHandle,GWL_WNDPROC));
       SetWindowLong(ClientHandle,GWL_WNDPROC, LongInt(FClientInstance));end;
      

  2.   

    为什么运行的时候会出现这样的错误
    Exception EDivByZero in module Project2.ext at 00062953.
    Division by zero.
      

  3.   

    FClientInstance := MakeObjectInstance(ClientWndProc);
       FPrevClientProc := Pointer(GetWindowLong(ClientHandle,GWL_WNDPROC));
       SetWindowLong(ClientHandle,GWL_WNDPROC, LongInt(FClientInstance));我只要把setwindowlong屏蔽就能通过?为什么