Re: React when the program isn't focused




"Fons Rave" <fonzzz-at-xs4all-dot-nl> schreef in bericht
news:45e23fa7$0$330$e4fe514c@xxxxxxxxxxxxxxxxx
My clock-program shows a small, borderless window with the date when you
move the mouse-cursor over the clock. When the mouse moves away the date
disappears. It uses:

procedure TFormMain.LabelTime1MouseEnter(Sender: TObject);
procedure TFormMain.LabelTime1MouseLeave(Sender: TObject);
procedure TFormMain.LabelTime1MouseMove(Sender: TObject; Shift:
TShiftState; X, Y: Integer);

It works when the clock is the focused program. But doesn't when the clock
is not the focused program. The clock is, of course, not always the
focused program so you probably already know my question: how can I make
my clock-program react on MouseEnter, MouseLeave & MouseMove when it is
not the focused program ?


---------
type
TForm1 = class(TForm)
procedure FormMouseMove(Sender: TObject; Shift: TShiftState; X,Y:
Integer);
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,Y:
Integer);
begin
//
end;

-----------

I've put a breakpoint on the 'end' line of the procedure and it is trapped
whether the app has focus or not. Likewise, mouse moves will be handled when
they are associated with a button or a label.
D6, XP.

Tom



.


Quantcast