跳到主要内容

github/tai

公开

Tai · Windows 软件与网站使用时长统计。上游 Planshit/Tai 的源码镜像,非灵栈原创;MIT 许可。来源:https://github.com/Planshit/Tai 。本次为手动同步,暂不提供安装包。

提交记录
修改Core/Librarys/Win32API.cs+19 −2看文件
@@ -202,7 +202,9 @@ namespace Core.Librarys
202202 #region 键盘钩子
203203 private const int WH_KEYBOARD_LL = 13;
204204 public const int WM_KEYDOWN = 0x0100;
205删除:
205新增: private const int WH_MOUSE_LL = 14;
206新增: public const int WM_LBUTTONDBLCLK = 0x202;
207新增: public const int WM_WHEEL = 0x20a;
206208 /// <summary>
207209 /// 设置键盘钩子
208210 /// </summary>
@@ -218,10 +220,25 @@ namespace Core.Librarys
218220 }
219221 }
220222
223新增:
224新增: /// <summary>
225新增: /// 设置鼠标钩子
226新增: /// </summary>
227新增: /// <param name="proc"></param>
228新增: /// <returns></returns>
229新增: public static IntPtr SetMouseHook(LowLevelKeyboardProc proc)
230新增: {
231新增: using (Process curProcess = Process.GetCurrentProcess())
232新增: using (ProcessModule curModule = curProcess.MainModule)
233新增: {
234新增: return SetWindowsHookEx(WH_MOUSE_LL, proc,
235新增: GetModuleHandle(curModule.ModuleName), 0);
236新增: }
237新增: }
221238 public delegate IntPtr LowLevelKeyboardProc(
222239 int nCode, IntPtr wParam, IntPtr lParam);
223240
224删除:
241新增:
225242
226243 [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
227244 public static extern IntPtr SetWindowsHookEx(int idHook,