📄 timer.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 + -