Matthew的Blog

  IT博客 :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
procedure TForm1.FormClick(Sender: TObject);
var winHWND, hCur:integer;
     winDC:integer;
     rect:TRect;
     //AFormat : Word;
     //AData,APalette : THandle;
     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);
     Image1.Picture.Bitmap.Assign(fBitmap);
     fBitmap.Free;
end;
posted on 2006-06-05 13:08 matthew 阅读(669) 评论(0)  编辑 收藏 引用 所属分类: Delphi编程
只有注册用户登录后才能发表评论。