unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls, ExtCtrls;
type
TForm1 = class(TForm)
Memo1: TMemo;
TrackBar1: TTrackBar;
Label1: TLabel;
Label2: TLabel;
Timer1: TTimer;
procedure Timer1Timer(Sender: TObject);
procedure TrackBar1Change(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
WinH: Hwnd;
NPt: TPoint;
Blink: Integer;
implementation
{$R *.dfm}
procedure TForm1.Timer1Timer(Sender: TObject);
begin
WinH :=GetFocus;
SetFocus;
ShowCaret(WinH);
GetCaretPos(NPt);
Caption :='X='+IntToStr(NPt.X)+' Y='+IntToStr(NPt.Y);
Blink :=GetCaretBlinkTime;
TrackBar1.Position :=Blink div 100;
Label2.Caption :=IntToStr(Blink)+ 'mS';
end;
procedure TForm1.TrackBar1Change(Sender: TObject);
begin
SetCaretBlinkTime(TrackBar1.Position*100);
Memo1.SetFocus;
end;
end.
|