Вниз
Скачать: CL | DM;

событие мыши   Найти похожие ветки 

 
Батя   (2006-07-30 11:42) [0]

Здравствуйте!
Мне нужно отслеживать перемещение мыши за пределами моей формы, MouseMove для этих целей не подходит, помогите пожалуйсто.


 
Rial ©   (2006-07-30 12:01) [1]

Windows.GetCursorPos();


 
Батя   (2006-07-30 12:21) [2]

Да это я знал, а мне надо не координаты п поймать событие когда мышка передвинулась в не формы. Спасибо


 
Zeqfreed ©   (2006-07-30 12:35) [3]

> [2] Батя   (30.07.06 12:21)

SetWindowsHookEx(WH_MOUSE…


 
Gydvin ©   (2006-07-30 12:40) [4]

завести цикл

unit Unit1;

interface

uses
 Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
 Dialogs, StdCtrls;

type
 TForm1 = class(TForm)
   Button1: TButton;
   Button2: TButton;
   procedure Button1Click(Sender: TObject);
   procedure Button2Click(Sender: TObject);
 private
   { Private declarations }
   stop: boolean;
 public
   { Public declarations }
 end;

var
 Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
 a, b: tpoint;
begin
 stop := true;
 while stop do begin
   Windows.GetCursorPos(a);
   if (a.X > left) and (a.X < left + width) and (a.Y > top) and (a.y < top + height) then
     caption := "FORM" else
   begin caption := "NO FORM";
     if (a.X <> b.X) or (a.y <> b.y) then begin
       showmessage("Move");
       b := a;
     end;
   end;
//caption:=inttostr(a.X)+"x"+ inttostr(a.y) ;
   application.ProcessMessages;
   sleep(100);
 end;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
 stop := false;
end;

end.



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.035 c
4-1146195109
Progh
2006-04-28 07:31
2006.08.20
Добавление и удаление сетевого ресурса


15-1153841744
0bsid
2006-07-25 19:35
2006.08.20
Ctrl+Shift+Space :(


3-1150146676
vvQuad
2006-06-13 01:11
2006.08.20
DBGrid, Query и печать


6-1144128262
CyMKuH
2006-04-04 09:24
2006.08.20
FTP клиент


15-1153430789
Батя
2006-07-21 01:26
2006.08.20
Слова Благодарности




   Наверх