diff --git a/Form1.Designer.cs b/Form1.Designer.cs index 4df3f34..b21d9be 100644 --- a/Form1.Designer.cs +++ b/Form1.Designer.cs @@ -38,6 +38,7 @@ private void InitializeComponent() this.label4 = new System.Windows.Forms.Label(); this.is_ms = new System.Windows.Forms.TextBox(); this.is_begin = new System.Windows.Forms.Button(); + this.comboBox1 = new System.Windows.Forms.ComboBox(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); this.groupBox3.SuspendLayout(); @@ -105,6 +106,7 @@ private void InitializeComponent() // // groupBox3 // + this.groupBox3.Controls.Add(this.comboBox1); this.groupBox3.Controls.Add(this.label4); this.groupBox3.Controls.Add(this.is_ms); this.groupBox3.Controls.Add(this.is_begin); @@ -144,6 +146,18 @@ private void InitializeComponent() this.is_begin.UseVisualStyleBackColor = true; this.is_begin.Click += new System.EventHandler(this.is_begin_Click); // + // comboBox1 + // + this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.comboBox1.FormattingEnabled = true; + this.comboBox1.Items.AddRange(new object[] { + "左键", + "右键"}); + this.comboBox1.Location = new System.Drawing.Point(257, 47); + this.comboBox1.Name = "comboBox1"; + this.comboBox1.Size = new System.Drawing.Size(121, 23); + this.comboBox1.TabIndex = 4; + // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F); @@ -176,6 +190,7 @@ private void InitializeComponent() private System.Windows.Forms.Label label4; private System.Windows.Forms.TextBox is_ms; private System.Windows.Forms.Button is_begin; + private System.Windows.Forms.ComboBox comboBox1; } } diff --git a/Form1.cs b/Form1.cs index 1e29fb0..98d9112 100644 --- a/Form1.cs +++ b/Form1.cs @@ -10,18 +10,25 @@ using System.Windows.Forms; namespace MouseClickTool -{ +{/// +/// 怎么简单怎么来了 +/// public partial class Form1 : Form { [System.Runtime.InteropServices.DllImport("user32.dll")] private static extern void mouse_event(uint dwFlags, uint dx, uint dy, uint dwData, IntPtr dwExtraInfo); - // private const uint RightDown = 0x0008; - // private const uint RightUp = 0x0010; + private const uint RightDown = 0x0008; + private const uint RightUp = 0x0010; private const uint LeftDown = 0x0002; private const uint LeftUp = 0x0004; public static void SendRightClick(uint posX, uint posY) + { + mouse_event(RightDown, posX, posY, 0, new System.IntPtr()); + mouse_event(RightUp, posX, posY, 0, new System.IntPtr()); + } + public static void SendLeftClick(uint posX, uint posY) { mouse_event(LeftDown, posX, posY, 0, new System.IntPtr()); mouse_event(LeftUp, posX, posY, 0, new System.IntPtr()); @@ -29,6 +36,7 @@ public static void SendRightClick(uint posX, uint posY) public Form1() { InitializeComponent(); + this.comboBox1.SelectedIndex = 0; } private void is_begin_Click(object sender, EventArgs e) @@ -54,15 +62,31 @@ await Task.Run(() => } }); is_begin.Text = string.Format("停止"); - for (; ; ) + if (this.comboBox1.SelectedIndex == 0) { - await Task.Run(() => + for (; ; ) { - uint x = (uint)Cursor.Position.X; - uint y = (uint)Cursor.Position.Y; - SendRightClick(x, y); - Thread.Sleep(result); - }); + await Task.Run(() => + { + uint x = (uint)Cursor.Position.X; + uint y = (uint)Cursor.Position.Y; + SendLeftClick(x, y); + Thread.Sleep(result); + }); + } + } + else + { + for (; ; ) + { + await Task.Run(() => + { + uint x = (uint)Cursor.Position.X; + uint y = (uint)Cursor.Position.Y; + SendRightClick(x, y); + Thread.Sleep(result); + }); + } } }); diff --git a/README.md b/README.md new file mode 100644 index 0000000..4124318 --- /dev/null +++ b/README.md @@ -0,0 +1,10 @@ +# MouseClickTool +简单好用的鼠标连点器,因为玩游戏需要连点,在网上找了好多连点器,有的居然还要收费,一向穷苦的我感觉为此花钱很不值得,索性自己写了个。。。 + +## 界面预览 +![IMG](https://iamverylovely.com/v2eximg/mouse.jpg?v=1.0.0) + +## 下载 (注意:需要右键以管理员身份运行,不然可能控制不了鼠标) +[本地下载](./bin/x64/Debug/MouseClickTool.exe) + +[备用下载](https://iamverylovely.com/opensource/MouseClickTool.zip) diff --git a/app.manifest b/app.manifest index 13a35fe..60a45a2 100644 --- a/app.manifest +++ b/app.manifest @@ -15,7 +15,7 @@ 如果你的应用程序需要此虚拟化来实现向后兼容性,则删除此 元素。 --> - + diff --git a/bin/x64/Debug/MouseClickTool.exe b/bin/x64/Debug/MouseClickTool.exe index 1a53400..9cd13dd 100644 Binary files a/bin/x64/Debug/MouseClickTool.exe and b/bin/x64/Debug/MouseClickTool.exe differ diff --git a/bin/x64/Debug/MouseClickTool.zip b/bin/x64/Debug/MouseClickTool.zip new file mode 100644 index 0000000..d612807 Binary files /dev/null and b/bin/x64/Debug/MouseClickTool.zip differ