Das könnte etwa so aussehen:
Delphi-Quellcode:
interface
type
TMyForm = class(TForm)
...
private
...
FMouseInForm: boolean;
procedure CMMouseEnter(var Message: TMessage); message CM_MOUSEENTER;
procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE;
public
property MouseInForm: boolean read FMouseInForm;
end;
implementation
procedure TMyForm.CMMouseEnter(var Message: TMessage);
begin
FMouseInForm := true;
end;
procedure TMyForm.CMMouseLeave(var Message: TMessage);
begin
FMouseInForm := false;
end;