unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 =
class(TForm)
procedure FormMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure FormMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
CursorPos: TPoint;
Links , Unten : Integer;
implementation
{$R *.dfm}
procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
GetCursorPos(CursorPos);
Links:=CursorPos.X;
Unten:=CursorPos.Y;
end;
procedure TForm1.FormMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
GetCursorPos(CursorPos);
Caption := IntToStr(CursorPos.X) +'
'+ IntToStr(CursorPos.Y);
if links > CursorPos.X
then showmessage('
Nach links')
else showmessage('
Nach rechts');
if unten > CursorPos.Y
then showmessage('
Nach oben')
else showmessage('
Nach unten');
end;
end.