⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 timer.pas

📁 光标跟随效果
💻 PAS
字号:
unit  Timer;

interface   

procedure TimerOn;  // 开启光标跟随定时器
procedure TimerOff; // 关闭光标跟随定时器

implementation

uses
  Windows, HintWindow;

var
  TimerHandle: DWORD;

procedure TimerProc(hwnd: HWND; uMsg: UINT; idEvent: UINT; dwTime: DWORD ); stdcall;
var
  FocusHandle: DWORD;
  CurrentPos: TPoint;
begin
  FocusHandle := GetFocus();
  AttachThreadInput(GetCurrentThreadId, GetWindowThreadProcessId(GetForegroundWindow(), nil), TRUE);
  GetCaretPos(CurrentPos);
  Windows.ClientToScreen(FocusHandle, CurrentPos);
  Active_Hint(CurrentPos.X + 5, CurrentPos.Y + 5, ' 啦啦啦,插入符号在这里?? :-)');
end;

procedure TimerOn;
begin
  TimerHandle := SetTimer(0, 0, 1000, @TimerProc);
end;

procedure TimerOff;
begin
  KillTimer(0, TimerHandle);
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -