//就是截取屏幕嘛
procedure TForm1.FormClick(Sender: TObject);
var winHWND, hCur : integer;
winDC : integer;
rect : TRect;
AFormat : Word;
AData : Cardinal;
APalette : Hpalette;
pt : TPoint;
fBitmap : TBitmap;
begin
hCur := GetCursor(); // 获得光标句柄
GetCursorPos(pt); // 记录光标位置
winHWND := GetDesktopWindow();
winDC := GetDC(winHWND);
GetWindowRect(winHWND, rect);
fBitmap := TBitmap.create;
fBitmap.width := rect.right - rect.left;
fBitmap.height := rect.bottom - rect.top;
BitBlt(fBitmap.canvas.handle, 0, 0, fBitmap.width, fBitmap.height, winDC, 0,
0, SRCCOPY);
DrawIcon(fBitmap.canvas.handle, pt.x, pt.y, hCur); //画光标
ReleaseDC(winHWND, winDC);
fBitmap.SaveToClipBoardFormat(AFormat, AData, APalette); //图像保存到剪贴板中
Clipboard.SetAsHandle(AFormat, AData);
Image1.Picture.Assign(Clipboard); //从剪贴板中读出图像
end;
在Windows2000+D5下运行通过