Autor Beitrag
chritzl
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 49

WIN 98 - bald Linux! :-)
Delphi 1, 4, 6
BeitragVerfasst: Mo 17.03.03 13:25 
hallo,
wie kann ich den Mauszeiger von meinem Programm steuern lassen?
:roll:

Also, er sollte sich von alleine bewegen..
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: Mo 17.03.03 13:30 
Stichwort: SetCursorPos() ...

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!
chritzl Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 49

WIN 98 - bald Linux! :-)
Delphi 1, 4, 6
BeitragVerfasst: Mo 17.03.03 13:55 
thanx!

_________________
Geld ist rund und rollt weg, Bildung bleibt! Heine
Now known as NuCHiLL
GoD_fire
Hält's aus hier
Beiträge: 6



BeitragVerfasst: Mi 19.03.03 13:14 
Wenn ich den befehl benutzen will muss ich doch variable als TPoint defienieren oder? und wie kann ich das machen ? einfach definieren ?


thx GoD_fire

_________________
Only GOD is bigger than ME !!!
wulfskin
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1349
Erhaltene Danke: 1

Win XP
D5 Pers (SSL), D2005 Pro, C, C#
BeitragVerfasst: Mi 19.03.03 15:19 
Hallo GoD_fire!

SetCursorPos ist eine API-Funktion und verlangt keine Variable vom Typ TPoint. Du musst nur die X und die Y-Koordinate übergeben:
ausblenden Quelltext
1:
2:
3:
4:
5:
begin
  X := 10;
  Y := 10;
  SetCursorPos(X, Y);  //obenlinks
end;
Gruß wulfskin!

P.S.: Wenn es eine Variable vom Typ TPoint wäre, könntest du das so machen:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
var
  P: TPoint;
begin
  P.x := 10;
  P.y := 10;
  SetCursoPos(P)
 //oder kurz
  SetCurosPos(Point(10, 10));
end;

_________________
Manche antworten um ihren Beitragszähler zu erhöhen, andere um zu Helfen.
GoD_fire
Hält's aus hier
Beiträge: 6



BeitragVerfasst: Do 20.03.03 09:24 
yo
thx
das hab isch mir schon gedacht aber ich war mir nicht sicher

icu GoD_fire

_________________
Only GOD is bigger than ME !!!
Terra23
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 872

Win 8
Delphi 7
BeitragVerfasst: Fr 25.04.03 00:37 
Bei GetCursorPos braucht man aber dann die TPoint, habe ich jedenfalls damals so gelernt.

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
Var Punkt: TPoint;

TForm1.Timer1Timer(Sender: TObject);
begin
GetCursorPos(Punkt);
SetCursorPos(Punkt.X+10, Punkt.Y+10);
end;


Das würde dann z.B. dafür sorgen, daß der Zeiger immer um 10 nach rechts und nach unten verschoben wird (wenn ich im Code nichts vergessen habe).

Grüße, Alex..

_________________
Hasta La Victoria Siempre