zoukankan      html  css  js  c++  java
  • WinAPI: 输入光标相关的函数[1]

      CreateCaret       {建立}
      DestroyCaret      {释放}
      ShowCaret         {显示}
      HideCaret         {隐藏}
      SetCaretPos       {设置位置}
      GetCaretPos       {获取位置}
      SetCaretBlinkTime {设置间隔时间}
      GetCaretBlinkTime {获取间隔时间}
    

    简单测试, 效果图:



    代码文件:
    unit Unit1;
    
    interface
    
    uses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs;
    
    type
      TForm1 = class(TForm)
        procedure FormMouseDown(Sender: TObject; Button: TMouseButton;
          Shift: TShiftState; X, Y: Integer);
      end;
    
    var
      Form1: TForm1;
    
    implementation
    
    {$R *.dfm}
    
    procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    begin
      CreateCaret(Handle, 0, 0, 20);
      SetCaretPos(X, Y);
      ShowCaret(Handle);
    end;
    
    end.
    
    窗体文件:
    object Form1: TForm1
      Left = 0
      Top = 0
      Caption = 'Form1'
      ClientHeight = 176
      ClientWidth = 298
      Color = clBtnFace
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      OldCreateOrder = False
      OnMouseDown = FormMouseDown
      PixelsPerInch = 96
      TextHeight = 13
    end
    
  • 相关阅读:
    js--DOM基本使用
    前端--js基础2
    前端--js基础1
    tcp/udp编程
    关于网络
    异常处理
    装饰器
    1.__new__ 魔术方法 单态(例)模式 __del__ 魔术方法(析构方法) __call__ 魔术方法
    面向对象程序设计及面向对象封装 目录
    script 标签里的 async 和 defer
  • 原文地址:https://www.cnblogs.com/del/p/1326289.html
Copyright © 2011-2022 走看看