From 3438a075967f2aa6b6ed6b6845d1e25364272003 Mon Sep 17 00:00:00 2001 From: huiyadanli Date: Tue, 17 Dec 2019 21:57:53 +0800 Subject: [PATCH] =?UTF-8?q?[#]=20=E4=BF=AE=E6=94=B9=E7=95=8C=E9=9D=A2,?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FormMultiInstance.Designer.cs | 110 +++++++++++------- .../FormMultiInstance.cs | 24 ++-- 2 files changed, 85 insertions(+), 49 deletions(-) diff --git a/RevokeMsgPatcher.MultiInstance/FormMultiInstance.Designer.cs b/RevokeMsgPatcher.MultiInstance/FormMultiInstance.Designer.cs index 5c9d5ac..25dc1e9 100644 --- a/RevokeMsgPatcher.MultiInstance/FormMultiInstance.Designer.cs +++ b/RevokeMsgPatcher.MultiInstance/FormMultiInstance.Designer.cs @@ -38,10 +38,12 @@ this.tabControl1 = new System.Windows.Forms.TabControl(); this.tabPage1 = new System.Windows.Forms.TabPage(); this.tabPage2 = new System.Windows.Forms.TabPage(); - this.label1 = new System.Windows.Forms.Label(); this.tabPage3 = new System.Windows.Forms.TabPage(); - this.label3 = new System.Windows.Forms.Label(); this.linkLabel1 = new System.Windows.Forms.LinkLabel(); + this.label3 = new System.Windows.Forms.Label(); + this.textBox1 = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.lblHowToUse = new System.Windows.Forms.LinkLabel(); this.tabControl1.SuspendLayout(); this.tabPage1.SuspendLayout(); this.tabPage2.SuspendLayout(); @@ -50,17 +52,17 @@ // // btnStartTimer // - this.btnStartTimer.Location = new System.Drawing.Point(8, 41); + this.btnStartTimer.Location = new System.Drawing.Point(158, 46); this.btnStartTimer.Name = "btnStartTimer"; this.btnStartTimer.Size = new System.Drawing.Size(91, 23); - this.btnStartTimer.TabIndex = 13; + this.btnStartTimer.TabIndex = 99; this.btnStartTimer.Text = "启动多开"; this.btnStartTimer.UseVisualStyleBackColor = true; this.btnStartTimer.Click += new System.EventHandler(this.btnStartTimer_Click); // // btnKillAll // - this.btnKillAll.Location = new System.Drawing.Point(19, 24); + this.btnKillAll.Location = new System.Drawing.Point(69, 41); this.btnKillAll.Name = "btnKillAll"; this.btnKillAll.Size = new System.Drawing.Size(118, 23); this.btnKillAll.TabIndex = 17; @@ -75,20 +77,21 @@ // // btnCloseAllMutex // - this.btnCloseAllMutex.Location = new System.Drawing.Point(19, 53); + this.btnCloseAllMutex.Location = new System.Drawing.Point(53, 80); this.btnCloseAllMutex.Name = "btnCloseAllMutex"; - this.btnCloseAllMutex.Size = new System.Drawing.Size(103, 23); + this.btnCloseAllMutex.Size = new System.Drawing.Size(152, 23); this.btnCloseAllMutex.TabIndex = 18; - this.btnCloseAllMutex.Text = "清理互斥句柄"; + this.btnCloseAllMutex.Text = "清理所有微信的互斥句柄"; this.btnCloseAllMutex.UseVisualStyleBackColor = true; this.btnCloseAllMutex.Click += new System.EventHandler(this.btnCloseAllMutex_Click); // // btnStopTimer // - this.btnStopTimer.Location = new System.Drawing.Point(8, 70); + this.btnStopTimer.Enabled = false; + this.btnStopTimer.Location = new System.Drawing.Point(158, 75); this.btnStopTimer.Name = "btnStopTimer"; this.btnStopTimer.Size = new System.Drawing.Size(91, 23); - this.btnStopTimer.TabIndex = 19; + this.btnStopTimer.TabIndex = 98; this.btnStopTimer.Text = "停止"; this.btnStopTimer.UseVisualStyleBackColor = true; this.btnStopTimer.Click += new System.EventHandler(this.btnStopTimer_Click); @@ -96,11 +99,11 @@ // lblProcNum // this.lblProcNum.AutoSize = true; - this.lblProcNum.Location = new System.Drawing.Point(76, 15); + this.lblProcNum.Location = new System.Drawing.Point(158, 23); this.lblProcNum.Name = "lblProcNum"; - this.lblProcNum.Size = new System.Drawing.Size(11, 12); + this.lblProcNum.Size = new System.Drawing.Size(95, 12); this.lblProcNum.TabIndex = 20; - this.lblProcNum.Text = "0"; + this.lblProcNum.Text = "当前微信数量:0"; // // tabControl1 // @@ -111,88 +114,115 @@ this.tabControl1.Location = new System.Drawing.Point(0, 0); this.tabControl1.Name = "tabControl1"; this.tabControl1.SelectedIndex = 0; - this.tabControl1.Size = new System.Drawing.Size(281, 144); + this.tabControl1.Size = new System.Drawing.Size(271, 146); this.tabControl1.TabIndex = 21; // // tabPage1 // - this.tabPage1.Controls.Add(this.label1); + this.tabPage1.Controls.Add(this.textBox1); this.tabPage1.Controls.Add(this.btnStopTimer); this.tabPage1.Controls.Add(this.lblProcNum); this.tabPage1.Controls.Add(this.btnStartTimer); this.tabPage1.Location = new System.Drawing.Point(4, 22); this.tabPage1.Name = "tabPage1"; this.tabPage1.Padding = new System.Windows.Forms.Padding(3); - this.tabPage1.Size = new System.Drawing.Size(273, 118); + this.tabPage1.Size = new System.Drawing.Size(263, 120); this.tabPage1.TabIndex = 0; this.tabPage1.Text = "自动模式"; this.tabPage1.UseVisualStyleBackColor = true; // // tabPage2 // + this.tabPage2.Controls.Add(this.lblHowToUse); this.tabPage2.Controls.Add(this.btnCloseAllMutex); this.tabPage2.Controls.Add(this.btnKillAll); this.tabPage2.Location = new System.Drawing.Point(4, 22); this.tabPage2.Name = "tabPage2"; this.tabPage2.Padding = new System.Windows.Forms.Padding(3); - this.tabPage2.Size = new System.Drawing.Size(273, 118); + this.tabPage2.Size = new System.Drawing.Size(263, 120); this.tabPage2.TabIndex = 1; this.tabPage2.Text = "手动功能"; this.tabPage2.UseVisualStyleBackColor = true; // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(5, 15); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(65, 12); - this.label1.TabIndex = 21; - this.label1.Text = "微信数量:"; - // // tabPage3 // + this.tabPage3.Controls.Add(this.label1); this.tabPage3.Controls.Add(this.linkLabel1); this.tabPage3.Controls.Add(this.label3); this.tabPage3.Location = new System.Drawing.Point(4, 22); this.tabPage3.Name = "tabPage3"; this.tabPage3.Padding = new System.Windows.Forms.Padding(3); - this.tabPage3.Size = new System.Drawing.Size(273, 118); + this.tabPage3.Size = new System.Drawing.Size(263, 120); this.tabPage3.TabIndex = 2; this.tabPage3.Text = "关于"; this.tabPage3.UseVisualStyleBackColor = true; // - // label3 - // - this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(31, 26); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(101, 12); - this.label3.TabIndex = 15; - this.label3.Text = "软件主页(开源):"; - // // linkLabel1 // this.linkLabel1.AutoSize = true; - this.linkLabel1.Location = new System.Drawing.Point(54, 54); + this.linkLabel1.Location = new System.Drawing.Point(160, 88); this.linkLabel1.Name = "linkLabel1"; this.linkLabel1.Size = new System.Drawing.Size(41, 12); this.linkLabel1.TabIndex = 16; this.linkLabel1.TabStop = true; this.linkLabel1.Text = "GitHub"; // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(53, 88); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(101, 12); + this.label3.TabIndex = 15; + this.label3.Text = "软件主页(开源):"; + // + // textBox1 + // + this.textBox1.BackColor = System.Drawing.SystemColors.ControlLightLight; + this.textBox1.Location = new System.Drawing.Point(7, 14); + this.textBox1.Multiline = true; + this.textBox1.Name = "textBox1"; + this.textBox1.ReadOnly = true; + this.textBox1.Size = new System.Drawing.Size(144, 92); + this.textBox1.TabIndex = 22; + this.textBox1.Text = "1.使用方法:点击【启动多开】之后,就可以启动多个微信了。\r\n2.注意:启动多个微信频率太快时,可能会失败。"; + // + // label1 + // + this.label1.Location = new System.Drawing.Point(23, 14); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(221, 61); + this.label1.TabIndex = 17; + this.label1.Text = "本工具是\r\n【 PC版微信/QQ/TIM防撤回补丁】\r\n的额外产物\r\n更多信息可以在软件主页查看"; + this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // lblHowToUse + // + this.lblHowToUse.AutoSize = true; + this.lblHowToUse.Location = new System.Drawing.Point(96, 16); + this.lblHowToUse.Name = "lblHowToUse"; + this.lblHowToUse.Size = new System.Drawing.Size(65, 12); + this.lblHowToUse.TabIndex = 19; + this.lblHowToUse.TabStop = true; + this.lblHowToUse.Text = "如何使用?"; + this.lblHowToUse.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.lblHowToUse_LinkClicked); + // // FormMultiInstance // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(281, 144); + this.ClientSize = new System.Drawing.Size(271, 146); this.Controls.Add(this.tabControl1); this.MaximizeBox = false; this.Name = "FormMultiInstance"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "微信多开小工具"; + this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.FormMultiInstance_FormClosed); this.tabControl1.ResumeLayout(false); this.tabPage1.ResumeLayout(false); this.tabPage1.PerformLayout(); this.tabPage2.ResumeLayout(false); + this.tabPage2.PerformLayout(); this.tabPage3.ResumeLayout(false); this.tabPage3.PerformLayout(); this.ResumeLayout(false); @@ -208,11 +238,13 @@ private System.Windows.Forms.Label lblProcNum; private System.Windows.Forms.TabControl tabControl1; private System.Windows.Forms.TabPage tabPage1; - private System.Windows.Forms.Label label1; private System.Windows.Forms.TabPage tabPage2; private System.Windows.Forms.TabPage tabPage3; private System.Windows.Forms.LinkLabel linkLabel1; private System.Windows.Forms.Label label3; + private System.Windows.Forms.TextBox textBox1; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.LinkLabel lblHowToUse; } } diff --git a/RevokeMsgPatcher.MultiInstance/FormMultiInstance.cs b/RevokeMsgPatcher.MultiInstance/FormMultiInstance.cs index 312c9a8..a08656e 100644 --- a/RevokeMsgPatcher.MultiInstance/FormMultiInstance.cs +++ b/RevokeMsgPatcher.MultiInstance/FormMultiInstance.cs @@ -1,14 +1,6 @@ -using Microsoft.Win32; -using System; +using System; using System.Collections.Generic; -using System.ComponentModel; -using System.Data; using System.Diagnostics; -using System.Drawing; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows.Forms; namespace RevokeMsgPatcher.MultiInstance @@ -28,11 +20,15 @@ namespace RevokeMsgPatcher.MultiInstance private void btnStartTimer_Click(object sender, EventArgs e) { mutexHandleCloseTimer.Start(); + btnStartTimer.Enabled = false; + btnStopTimer.Enabled = true; } private void btnStopTimer_Click(object sender, EventArgs e) { mutexHandleCloseTimer.Stop(); + btnStartTimer.Enabled = true; + btnStopTimer.Enabled = false; } private List wechatProcesses = new List(); @@ -82,7 +78,7 @@ namespace RevokeMsgPatcher.MultiInstance } } - lblProcNum.Text = num.ToString(); + lblProcNum.Text = "当前微信数量:" + num.ToString(); } private void btnKillAll_Click(object sender, EventArgs e) @@ -108,6 +104,14 @@ namespace RevokeMsgPatcher.MultiInstance ProcessUtil.CloseMutexHandle(processes); } + private void lblHowToUse_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) + { + Process.Start("https://github.com/huiyadanli/RevokeMsgPatcher"); + } + private void FormMultiInstance_FormClosed(object sender, FormClosedEventArgs e) + { + mutexHandleCloseTimer.Stop(); + } } }