本文整理自网络,侵删。
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, ComCtrls;
type
TForm1 = class(TForm)
Timer1: TTimer;
procedure Timer1Timer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Timer1Timer(Sender: TObject);
var
px,py : Integer;
Pscreen : hdc;
can : tcanvas;
p : TPoint;
begin
Pscreen:=getdc(0);
can:=tcanvas.Create;
can.Handle:=Pscreen;
can.Brush.style:=bsclear;
can.Pen.color:=clwindow;
can.Pen.Width := 8;
GetCursorPos(P); //得到鼠标坐标
px := p.X;
py := p.Y;
can.Ellipse(px-3,py-3,px+3,py+3);
can.Free;
releasedc(0,Pscreen);
end;
运行该程序后,关闭该程序的操作步骤如下:
步骤1:按<Ctrl+Alt+Delete>键。
步骤2:单击“任务管理器”按钮。
步骤3:选中该程序的可执行文件“Project1”,单击“结束进程”即可。
相关阅读 >>
Delphi winapi: gettopwindow - 获取指定窗口的子窗口中最顶层的窗口句柄
Delphi 跨平台的,在fmx中读取icon文件的每一帧到bitmap
Delphi blockread和blockwrite读写文件
Delphi使用tclientdataset时不携带midas.dll的方法
更多相关阅读请进入《Delphi》频道 >>