Здравствуйте, ekamaloff, Вы писали:
E>Здравствуйте, Eagle-XK, Вы писали:
E>А если так:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls;
type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
procedure TmrTimer(Sender: TObject);
procedure PnlCaptureMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
end;
var
Form1: TForm1;
Pnl, PnlCapture: TPanel;
M: TMemo;
Tmr: TTimer;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
Pnl := TPanel.Create(Self);
Pnl.Parent := Self;
M := TMemo.Create(Pnl);
M.Parent := Pnl;
M.Align := alClient;
PnlCapture := TPanel.Create(Self);
PnlCapture.Parent := Self;
PnlCapture.OnMouseMove := PnlCaptureMouseMove;
PnlCapture.Left := 200;
Tmr := TTimer.Create(Self);
Tmr.Enabled := True;
Tmr.Interval := 100;
Tmr.OnTimer := TmrTimer;
end;
procedure TForm1.PnlCaptureMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
var
P:TPoint;
begin
if not ((x>=0) and (y>=0) and (x<PnlCapture.width) and (y<PnlCapture.height)) then
begin
if GetCaptureControl=PnlCapture then ReleaseCapture;
end
else
if not (GetCaptureControl=PnlCapture) then SetCaptureControl(PnlCapture);
end;
procedure TForm1.TmrTimer(Sender: TObject);
var
CurPos: TPoint;
begin
GetCursorPos(CurPos);
CurPos := Pnl.ScreenToClient(CurPos);
if WindowFromPoint(Mouse.CursorPos) = Pnl.Handle then
// if ((CurPos.X >= 0) and (CurPos.X <= Pnl.Width)) and ((CurPos.Y >= 0) and (CurPos.Y <= Pnl.Height)) then
Beep;
end;
end.
Проверь сам... Я уже искал в этом направлении... Сейчас есть мысль "углубить" поиски

RSDN@Home v.1.1.4
ORIGIN: Рай и ад отличаются лишь поставщиком софта.