unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics,
Controls, Forms, Dialogs, StdCtrls, ComCtrls, ExtCtrls;
const
WM_MYMEMO_ENTER = WM_USER + 500;
type
TForm1 = class(TForm)
Memo1: TMemo;
procedure Memo1Enter(Sender: TObject);
procedure Memo1Exit(Sender: TObject);
procedure Memo1Change(Sender: TObject);
private
public
procedure WMMYMEMOENTER(var Message: TMessage);
message WM_MYMEMO_ENTER;
end;
var Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.WMMYMEMOENTER(var Message: TMessage);
begin
CreateCaret(Memo1.Handle,0,0,0);
end;
procedure TForm1.Memo1Enter(Sender: TObject);
begin
PostMessage(Handle, WM_MYMEMO_ENTER, 0, 0);
end;
procedure TForm1.Memo1Exit(Sender: TObject);
begin
CreateCaret(Memo1.handle,1,1,1);
end;
procedure TForm1.MemoChange(Sender: TObject);
begin
CreateCaret(Memo1.handle,0,0,0);
end;
end.