送原程序,增加了鼠标移动自动退出
这会不怕白痴妹妹了吧,可作为屏幕保护
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, jpeg, ExtCtrls;
type
TfrmMain = class(TForm)
Image1: TImage;
Timer1: TTimer;
procedure Timer1Timer(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
x,y:Integer;
procedure DrawRose(x,y:Integer);
public
{ Public declarations }
end;
var
frmMain: TfrmMain;
implementation
{$R *.dfm}
{ TForm1 }
procedure TfrmMain.DrawRose(x, y: Integer);
var
sc:TCanvas;
begin
sc:=TCanvas.Create;
try
sc.Handle:=GetDC(0);
sc.Pen.Style := psClear;
sc.Draw(x - Image1.Width,y - Image1.Height,image1.Picture.Graphic);
ReleaseDC(0, sc.handle);
finally
sc.free;
end;
end;
procedure TfrmMain.Timer1Timer(Sender: TObject);
begin
randomize;
DrawRose(Random(Screen.Width + Image1.Width),Random(Screen.Height + Image1.Height));
if (x <> 0) and (y <> 0) then
begin
if (Mouse.CursorPos.X <> x) and (Mouse.CursorPos.Y <> y) then
begin
Application.Terminate;
end;
end;
x := Mouse.CursorPos.X;
y := Mouse.CursorPos.Y;
end;
procedure TfrmMain.FormCreate(Sender: TObject);
begin
if FindWindow(nil,'情人节玫瑰') > 0 then
Application.Terminate;
Caption := '情人节玫瑰';
x := 0;
y := 0;
end;
end.