Delphi CALL WINAPI: Input cursor-related functions [2]

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.