共 25 篇文章 |
|
C#设置全局热键ASDF和空格键。private static LowLevelKeyboardProc _proc = HookCallback;private static IntPtr _hookID = IntPtr. 阅140 转1 评0 公众公开 23-03-23 18:20 |
C#折叠代码块 #region #endregion.#region 这里将显示折叠后的标题。/////这里是需要折叠的代码块。 阅10 转0 评0 公众公开 23-03-22 16:34 |
public Hotkey(IntPtr hWnd) { this.hWnd = hWnd;} } public void OnHotkey(int HotkeyID) { if (HotkeyID == a) { QJ.mclick(QJ.A键); } if (HotkeyID == s) { QJ.mclick(QJ.S键); } if (HotkeyID == d) { QJ.mclick(QJ.D键); } if (HotkeyID == f) { QJ.mclick(QJ.F... 阅15 转0 评0 公众公开 23-03-22 16:32 |
阅296 转0 评0 公众公开 23-03-21 17:12 |
C#使用定时器得到鼠标移动的坐标点。private void timer1_Tick(object sender, EventArgs e) { Point screenPoint = Control.MousePosition;//鼠标相对于屏幕左上角的坐标 this.Text = (screenPoint.X - QJ.flgP.X).ToString() + "," + (screenPoint.Y - QJ.flgP.Y).ToString(); } 阅1 转0 评0 公众公开 23-03-21 16:57 |
阅24 转0 评0 公众公开 23-03-20 17:43 |
C#获取CPU机器码并转换成10进制。//截取最后4位 int s = Convert.ToInt32(cpuInfo,16);//16进制转换成10进制 cpuInfo = s.ToString(); mo.Dispose(); } } } catch (Exception) { th... 阅32 转0 评0 公众公开 23-03-17 17:29 |
阅10 转0 评0 公众公开 23-03-17 17:23 |
RECT_INFO rect = new RECT_INFO();//h为已获取到的句柄 this.Location = new Point(rect.Left, rect.Top+120);//让程序套到目标窗口里对应位置。 阅172 转0 评0 公众公开 23-03-17 17:19 |