Einzelnen Beitrag anzeigen

Sebastian Nintemann
(Gast)

n/a Beiträge
 
#5

Re: Mausposition setzten und herausfinden

  Alt 4. Mai 2004, 15:15
Hallo Dragon 27,

Mouse.GetCursor kennt mein Delphi nicht. Es kennt aber Mouse.CursorPos vom Typ TPoint. Alternativ die APIs GetCursorPos / SetCursorPos.
Mal ein Beispiel mit Mouse.CursorPos:

Delphi-Quellcode:
var
  p: TPoint;
begin
  p := Mouse.CursorPos;
  LabelP.Caption := 'X: ' + IntToStr(p.X) + ' / Y: ' + IntToStr(p.Y); //Koordinaten ausgeben
  p.X := p.X + 100; //X-Wert und
  p.Y := p.Y + 100; //Y-Wert verändern
  Mouse.CursorPos := p; //Neue Koordinaten übergeben
end;
Viele Grüße, Sebastian
  Mit Zitat antworten Zitat