Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2006.08.20;
Скачать: 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 вся ветка

Текущий архив: 2006.08.20;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.049 c
8-1140450767
SPy
2006-02-20 18:52
2006.08.20
VSync (Вертикальная синхронизация)


2-1154270540
Homo Sapiens
2006-07-30 18:42
2006.08.20
Progressbar


1-1152080166
ancot
2006-07-05 10:16
2006.08.20
Цвет TMainMenu


11-1131530297
algambra
2005-11-09 12:58
2006.08.20
Совместное исп. KOL and VCL


2-1154426141
Батя
2006-08-01 13:55
2006.08.20
Стили в Delphi