提交记录修改Core/Librarys/Win32API.cs+19 −2看文件
| @@ -202,7 +202,9 @@ namespace Core.Librarys | ||
| 202 | 202 | #region 键盘钩子 |
| 203 | 203 | private const int WH_KEYBOARD_LL = 13; |
| 204 | 204 | 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; | |
| 206 | 208 | /// <summary> |
| 207 | 209 | /// 设置键盘钩子 |
| 208 | 210 | /// </summary> |
| @@ -218,10 +220,25 @@ namespace Core.Librarys | ||
| 218 | 220 | } |
| 219 | 221 | } |
| 220 | 222 | |
| 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 | 新增: } | |
| 221 | 238 | public delegate IntPtr LowLevelKeyboardProc( |
| 222 | 239 | int nCode, IntPtr wParam, IntPtr lParam); |
| 223 | 240 | |
| 224 | 删除: | |
| 241 | 新增: | |
| 225 | 242 | |
| 226 | 243 | [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)] |
| 227 | 244 | public static extern IntPtr SetWindowsHookEx(int idHook, |

