timer.pas
来自「光标跟随效果」· PAS 代码 · 共 39 行
PAS
39 行
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 + =
减小字号Ctrl + -
显示快捷键?