Autor Beitrag
webmaker
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 205



BeitragVerfasst: Fr 29.08.03 17:39 
Mein Vorhaben ist, dass ich die Mauskoordinaten auf dem ganen Bildschirm haben will.
DAs Problem ist ja, dass WM_Mousemove nur dann aufgerufen wird, wenn ´sich der Cursor auf dem Form befindet
Wie mache ich das jetzt genau?

_________________
.::Wissen ist Macht, nichts wissen macht nichts::.
derDoc
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 623

Win Vista Prof
D2007 Prof
BeitragVerfasst: Fr 29.08.03 18:22 
Nimm einen Timer, setze das Intervall auf 1 und nutze folgenden Code:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
var
  Punkt: TPoint;
begin
  GetCursorPos(Punkt);
  //Mit Punkt.X und Punkt.Y kannst du dann die Koordinaten bekommen
  ...

_________________
MfG derDoc
There are only 10 types of people: those who understand binary and those who don't.
webmaker Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 205



BeitragVerfasst: Fr 29.08.03 19:49 
Ich will aber keinen Timer nutzen ;-)
danke dir trotzdem !
Denn wenn es schon ein Event gibt, dann sollte man es auch nutzen.
Mein code sieht so aus:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
  private
   procedure WMMOUSEMOVE(var msg : TMessage); message WM_MOUSEMOVE;
{...}

procedure TForm1.WMMOUSEMOVE(var msg : TMessage);
var
 aPoint : TPoint;
begin
 GetCursorPos(aPoint);
 Form1.Caption := 'x: ' + IntToStr(aPoint.x) + ' y: ' + IntToStr(aPoint.x);
end;

Funktioniert ja auch prakitsch, nur halt das mit dem Clientbereich des fensters...
Maus sich also auf Form befinden...
Oder muss ich einen Timer nutzen? Ich hoffe mal nicht...

_________________
.::Wissen ist Macht, nichts wissen macht nichts::.
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: Fr 29.08.03 19:54 
Das ganze funktioniert mit einem Hook! Schau dir mal auf www.assarbad.org das Hook-Tutorial an...

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



BeitragVerfasst: Fr 29.08.03 19:58 
mhm doch sowas hochgegriffenes...mal kucken...

_________________
.::Wissen ist Macht, nichts wissen macht nichts::.