Autor Beitrag
unstable
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 32

windows xp/2000
D5
BeitragVerfasst: Mi 05.01.05 15:33 
hallo,

gibt es einen event wenn die Maus nicht mehr über die Form ist?
Kann man das irgendwie abfangen?

Danke für die hilfe,
-_- unstable

_________________
why bother with a sig?
WeBsPaCe
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2322
Erhaltene Danke: 1

FireFox 3, Internet Explorer 6 SP1
D1, D3Prof, D6Pers, D7Pers+Indy, VisualStudio Express
BeitragVerfasst: Mi 05.01.05 15:42 
Hi!!!

Du kannst beim Ereigniss OnMouseMove nachgucken, ob die Mouseposition am Rand von deiner Form ist und dann annehmen, dass der User auch ganz rausfährt!!

War das verständlich?? :wink:

_________________
Steht der Bauer im Gemüse, hat er später grüne Füße.
rochus
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 416

Win XP Prof, Fedora Core 4, SuSE 7.0
D7 Ent, D2005 Pers
BeitragVerfasst: Mi 05.01.05 15:48 

_________________
Im Nachhinein ist man immer ein Schlauch!
"Dream as if you'll live forever, live as if you'll die today!" James Dean
unstable Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 32

windows xp/2000
D5
BeitragVerfasst: Mi 05.01.05 15:51 
das war verständlich, aber nicht ganz das was ich wollte.

die idee die da hinter steckt ist die folgende:
ich versuche eine sidebar zu bauen, so wie die taskbar, nur dann links am fentser-/programmrand.
Immer wenn die Maus an der seite des Programms/Fensters kommt, dann wird diese bar 'aufgeklappt'.
Und wenn die Maus weiter zur mitte des Bildschirms geht, dann geht die bar wieder weg.
Genauso wie der startbalken, wenn man das eingestellt hat.
So weit habe ich es fertig programmiert.
Nun kann es aber sein das dass Programm nicht auf Vollbild gesetzt wird.
Und wenn die maus dann mal nicht auf das Fenster ist, aber die bar ist aufgeklappt, dann will ich das sie wieder zu geht.

Ich habe hierbei an einen timer gedacht der immer wieder nachguckt ob díe Maus da ist.
Ich weiss aber nicht wie ich das mach.
Im Internet stand was von GetCapture, aber das hat auch nicht wirklich funktioniert.

_________________
why bother with a sig?
Sprint
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 849



BeitragVerfasst: Mi 05.01.05 15:56 
unstable hat folgendes geschrieben:
ich versuche eine sidebar zu bauen, so wie die taskbar, nur dann links am fentser-/programmrand.

Also in einer Form oder auf'm Desktop?

Zitat:
Ich habe hierbei an einen timer gedacht

Einfach vergessen das es die TTimer Komponente gibt. Die braucht kein Mensch.

Zitat:
der immer wieder nachguckt ob díe Maus da ist.

Dafür sorgt Windows schon und schickt dir regelmäßig Nachrichten.

_________________
Ciao, Sprint.
unstable Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 32

windows xp/2000
D5
BeitragVerfasst: Mi 05.01.05 16:02 
es ist gedacht für die Form, nicht der Desktop.

Zitat:
Dafür sorgt Windows schon und schickt dir regelmäßig Nachrichten.

wie denn, und wie fange ich die denn ab?

WM_MOUSELEAVE könnte sein, aber ich bin ein newb mit delphi, und weiss noch net so genau etwas damit anzufangen... :(

sorry für die dummen fragen......

_________________
why bother with a sig?
unstable Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 32

windows xp/2000
D5
BeitragVerfasst: Mi 05.01.05 16:17 
danke leute für die mühe, aber ich jetzt doch noch was im internet gefunden:

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
procedure TForm1.Timer1Timer(Sender: TObject); 
var 
  mouseCoords: TPoint; 
begin 
  GetCursorPos(mouseCoords); 
  if (mouseCoords.x < Form1.Left) or 
    (mouseCoords.y < Form1.Top) or 
    (mouseCoords.x > Form1.Left+Form1.Width) or 
    (mouseCoords.y > Form1.Top+Form1.Height) then 
      Timer2.Enabled := True;
end;


so gehts auch.

danke,
-_- Unstable

_________________
why bother with a sig?
Sprint
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 849



BeitragVerfasst: Mi 05.01.05 16:24 
Du brauchst weder TTimer noch GetCursorPos. Windows informiert dich regelmäßig über die aktivität der Maus und über die Position.

_________________
Ciao, Sprint.