Autor Beitrag
volvox
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 112

WIN XP
Delphi 7 Personal
BeitragVerfasst: Fr 30.06.06 23:41 
Hi, wie bekomme ich es hin, dass die Maus die Form nicht mehr verlassen kann?
Hack Gott
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 409

Windows Vista
Delphi 2005 Personal, Delphi 7
BeitragVerfasst: Sa 01.07.06 00:00 
Ich würde immer schauen wo die Maus gerade ist, und wenn sie nicht mehr auf der Form ist, würde ich sie wieder zurückschieben.
Einfach mal die Suche bemühen.

_________________
"Je mehr Käse, desto mehr Löcher; Je mehr Löcher, desto weniger Käse. Daraus folgt: Je mehr Käse desto weniger Käse!"
John Steam
Hält's aus hier
Beiträge: 3



BeitragVerfasst: Sa 01.07.06 13:05 
Hi,

das geht mit der API-Programmierung. Bin zwar nicht fit in API-Programmierung aber mit:

ausblenden Delphi-Quelltext
1:
2:
GetCursorPos(CursorPos);
SetCursorPos(x, y);


müßtest du weiterkommen.
Wobei CursorPos vom Typ TPoint ist.

Ich stell mir das prinzipiell so vor:


ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
var
 CursorPos: TPoint;

GetCursorPos(CursorPos);

if (CursorPos.x < FormStartPosX) then x:=FormStartPosX
else if (CursorPos.x > FormEndPosX) then x:=FormEndPosX;

if (CursorPos.y < FormStartPosY) then y:=FormStartPosY
else if (CursorPos.y > FormEndPosY) then y:=FormEndPosY;

SetCursorPos(x,y)



Weis allerdings nicht, ob das klappt.

mfg
wurzelsepp

Moderiert von user profile iconraziel: Delphi-Tags hinzugefügt
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Sa 01.07.06 15:30 
*räusper* Suche in der Entwickler-Ecke CLIPCURSOR

_________________
We are, we were and will not be.
galagher
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2562
Erhaltene Danke: 46

Windows 10 Home
Delphi 10.1 Starter, Lazarus 2.0.6
BeitragVerfasst: So 02.07.06 13:11 
Hallo!

ClipCursor:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
var
  ARect: TRect;
begin
 ARect := Rect(Left, Top, Left+Width, Top+Height);
 ClipCursor(@ARect);

_________________
gedunstig war's - und fahle wornen zerschellten karsig im gestrock. oh graus, es gloomt der jabberwock - und die graisligen gulpen nurmen!