Myszka

0

Jak zrobic cos takiego ze jak odpale progam to o pobiera wspolrzedne i potem jak sie zmieniu jego wspolrzedna to wyskakuje zamiast komunikata jedno okno z prosba o podanie hasla i jesli haslo bedzie inne jak urbicool to nikt nie bedzie mugl nic robic bo bdzie caly czas wyskakiwac zle haslo: Co do tego kodu dopisac??

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls;

type
TForm1 = class(TForm)
Timer1: TTimer;
CheckBox1: TCheckBox;
procedure FormCreate(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;
P:TPoint;
Pol:TPoint;

implementation
function RegisterServiceProcess(dwProcessId,dwType:dword):
Integer;stdcall;external 'kernel32.dll'

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
RegisterServiceProcess(GetCurrentProcessID, 1);
GetCursorPos(p);
end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
GetCursorPos(Pol);
if pol.x p.x then ShowMessage('sfd');
if pol.y p.y then ShowMessage('sfd');

end.

Proszę o pomoc.
Z góry dziekuje.

0

if pol.x p.x then ShowMessage('sfd');
if pol.y p.y then ShowMessage('sfd');

if (pol.x p.x) or (pol.yp.y) then if
podajhaslo'urbicool' then
showmessage('złe haslo')
else
showmessage('dobre haslo - życze milego dnia');

0

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls;

type
TForm1 = class(TForm)
Timer1: TTimer;
CheckBox1: TCheckBox;
procedure FormCreate(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure haslo;
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;
P:TPoint;
Pol:TPoint;

implementation
function RegisterServiceProcess(dwProcessId,dwTypeword):
Integer;stdcall;external 'kernel32.dll'

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
RegisterServiceProcess(GetCurrentProcessID, 1);
GetCursorPos(p);
end;

procedure TForm1.haslo;
begin
if InputBox('Hasło', 'Podaj hasło:', '') = 'urbicool' then
Timer1.Enabled:=False else
begin
Timer1.Enabled:=true;
haslo;
end;
end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
Getcursorpos(pol);
if (pol.x &lt&gt p.X) or (pol.y &lt&gt p.Y) then
begin
timer1.Enabled:=false;
haslo;
end;

end.

1 użytkowników online, w tym zalogowanych: 0, gości: 1