Вниз
Скачать: 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.026 c
15-1153819930
CHES
2006-07-25 13:32
2006.08.20
Вопрос по MSSQL 2000


2-1153393351
Mintos
2006-07-20 15:02
2006.08.20
Перевод фамилий


5-1137932033
hawkins
2006-01-22 15:13
2006.08.20
ZipTV триальная версия


2-1154552866
susergey
2006-08-03 01:07
2006.08.20
Абракадабра в TMemo


4-1146219048
Creative
2006-04-28 14:10
2006.08.20
как избавиться от мерцания?




   Наверх