小
小小小虾米
Unregistered / Unconfirmed
GUEST, unregistred user!
如何将下面代码截获到的鼠标保存为文件?请各位大侠指教!谢谢!!!!!!!!!程序首先通过GetCursorPos函数取得鼠标的位置,并且存储在TPoint类型的变量point中,ScreenToClient函数用于把point表示的坐标从屏幕坐标系统映射到客户坐标中。然后创建一个TIcon对象,通过GetCursor函数取得程序鼠标的句柄。最后通过Canvas.Draw (point.X,point.Y,ico)语句在单击的位置上绘制本程序的鼠标形状。 程序代码如下:unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs;type TfrmMain = class(TForm) procedure FormClick(Sender: TObject); private { Private declarations } public { Public declarations } end; var frmMain: TfrmMain;implementation{$R *.dfm} procedure TfrmMain.FormClick(Sender: TObject);var ico:TIcon; point:TPoint;begin GetCursorPos(point); point:=ScreenToClient(point); ico:=TIcon.Create; ico.Handle:=GetCursor(); Canvas.Draw(point.X,point.Y,ico); ico.Free;end; end.