This example tests the speed at which the cursor is set to blink, noting that this affects other programs and that the exit should revert to the system default of 530 milliseconds.
This example effect chart:
Code files:Unit Unit1;
Interface
Uses
Windows, Messages, sysutils, variants, Classes, Graphics, Controls, Forms,
Dialogs, Stdctrls, Extctrls;
Type
TForm1 = Class (Tform)
Radiogroup1:tradiogroup;
Procedure Formcreate (Sender:tobject);
Procedure Formmouseup (Sender:tobject; Button:tmousebutton;
Shift:tshiftstate; X, Y:integer);
Procedure Radiogroup1click (Sender:tobject);
Procedure Formdestroy (Sender:tobject);
End
Var
Form1:tform1;
Implementation
{$R *.DFM}
Procedure Tform1.formcreate (Sender:tobject);
Begin
Radiogroup1.caption: = ' cursor blink speed (ms) ';
RadioGroup1.Items.CommaText: = ' 1000,500,200 ';
End
Procedure Tform1.formdestroy (Sender:tobject);
Begin
Setcaretblinktime (530);
End
Procedure Tform1.formmouseup (Sender:tobject; Button:tmousebutton;
Shift:tshiftstate; X, Y:integer);
Begin
Destroycaret;
CreateCaret (Handle, 0, 0, 20);
Setcaretpos (X,y);
ShowCaret (Handle);
End
Procedure Tform1.radiogroup1click (Sender:tobject);
Var
ms:cardinal;
Begin
MS: = Strtointdef (Radiogroup1.items[radiogroup1.itemindex], 530);
Setcaretblinktime (MS);
End
End.