希望知情人解答 非常感谢!

解决方案 »

  1.   

    1:用FindWindow查找你的主窗体,如果找到说明运行了,但不是很可靠。
    2:用GetDC(0)得到桌面设备句柄,然后用BitBlt,例如:
    procedure TForm4.CaptureScreen;
    var
      dc: HDC;
      bmp: TBitmap;
    begin
      dc := GetDC(0);
      bmp := TBitmap.Create;
      try
        bmp.Width := Screen.Width;
        bmp.Height := Screen.Height;
        bmp.PixelFormat := pf24Bit;
        BitBlt(bmp.Canvas.Handle, 0, 0, bmp.Width, bmp.Height, dc, 0, 0, SRCCOPY);
        bmp.SaveToFile('c:\tmep.bmp');
      finally
        bmp.Free;
        ReleaseDC(0, dc);
      end;
    end;