unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls;
type
TForm1 =
class(TForm)
Button1: TButton;
Timer1: TTimer;
procedure Button1Click(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure OnKey(Sender: TObject;
var Key: Word; Shift: TShiftState);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
inter : Boolean;
pos : TPoint;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
if inter = true
then
begin
inter := false;
end
else
begin
inter := true;
//application.Minimize;
end;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
if not inter = false
then
begin
pos := Point(mouse.CursorPos.X-2,mouse.CursorPos.Y-2);
mouse.CursorPos := pos;
end;
end;
procedure TForm1.OnKey(Sender: TObject;
var Key: Word; Shift: TShiftState);
begin
if Key = vk_down
then inter := false;
end;
end.