diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0bc8230 --- /dev/null +++ b/.gitignore @@ -0,0 +1,29 @@ + +#ignore thumbnails created by windows +Thumbs.db +#Ignore files build by Visual Studio +*.obj +*.exe +*.pdb +*.user +*.aps +*.pch +*.vspscc +*_i.c +*_p.c +*.ncb +*.suo +*.tlb +*.tlh +*.bak +*.cache +*.ilk +*.log +[Bb]in +[Dd]ebug*/ +*.lib +*.sbr +obj/ +[Rr]elease*/ +_ReSharper*/ +[Tt]est[Rr]esult* diff --git a/AutoClicker.sln b/AutoClicker.sln new file mode 100644 index 0000000..968df64 --- /dev/null +++ b/AutoClicker.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.24720.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutoClicker", "AutoClicker\AutoClicker.csproj", "{E9F5559C-E09D-4CAF-B8C7-3D255D804B28}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E9F5559C-E09D-4CAF-B8C7-3D255D804B28}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E9F5559C-E09D-4CAF-B8C7-3D255D804B28}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E9F5559C-E09D-4CAF-B8C7-3D255D804B28}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E9F5559C-E09D-4CAF-B8C7-3D255D804B28}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/AutoClicker/App.config b/AutoClicker/App.config new file mode 100644 index 0000000..74ade9d --- /dev/null +++ b/AutoClicker/App.config @@ -0,0 +1,6 @@ + + + + + + diff --git a/AutoClicker/AutoClicker.cs b/AutoClicker/AutoClicker.cs new file mode 100644 index 0000000..ba243dc --- /dev/null +++ b/AutoClicker/AutoClicker.cs @@ -0,0 +1,351 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Threading; +using System.Windows.Forms; + +namespace AutoClicker +{ + class AutoClicker + { + #region "Button" + public enum ButtonType + { + Left, + Middle, + Right + } + + private ButtonType buttonType; + private bool doubleClick; + #endregion + + #region "Location" + public enum LocationType + { + Cursor, + Fixed, + Random, + RandomRange + } + + private LocationType locationType; + private int x; + private int y; + private int width; + private int height; + #endregion + + #region "Delay" + public enum DelayType + { + Fixed, + Range + } + + private DelayType delayType; + private int delay; + private int delayRange; + #endregion + + #region "Count" + public enum CountType + { + Fixed, + UntilStopped + } + + private CountType countType; + private int count; + #endregion + + #region "Update storage" + private bool buttonUpdated; + private ButtonType tmpButtonType; + private bool tmpDoubleClick; + + private bool locationUpdated; + private LocationType tmpLocationType; + private int tmpX; + private int tmpY; + private int tmpWidth; + private int tmpHeight; + + private bool delayUpdated; + private DelayType tmpDelayType; + private int tmpDelay; + private int tmpDelayRange; + + private bool countUpdated; + private CountType tmpCountType; + private int tmpCount; + #endregion + + Thread Clicker; + Random rnd; + + public AutoClicker() + { + rnd = new Random(); + } + + private void Click() + { + //System.Diagnostics.Debug.Print("Click() started"); + SyncSettings(); + int remaining = count; + //System.Diagnostics.Debug.Print("Count type: {0}, count: {1}", countType, count); + while (countType == CountType.UntilStopped || remaining > 0) + { + if (!IsAlive) + return; + SyncSettings(); + List inputs = new List(); + + // Move the mouse if required. + if (locationType == LocationType.Fixed) + { + Win32.INPUT input = new Win32.INPUT + { + type = Win32.SendInputEventType.InputMouse, + mi = new Win32.MOUSEINPUT + { + dx = Win32.CalculateAbsoluteCoordinateX(x), + dy = Win32.CalculateAbsoluteCoordinateX(y), + dwFlags = Win32.MouseEventFlags.Move | Win32.MouseEventFlags.Absolute + } + }; + inputs.Add(input); + } + else if (locationType == LocationType.Random) + { + Win32.INPUT input = new Win32.INPUT + { + type = Win32.SendInputEventType.InputMouse, + mi = new Win32.MOUSEINPUT + { + dx = rnd.Next(65536), + dy = rnd.Next(65536), + dwFlags = Win32.MouseEventFlags.Move | Win32.MouseEventFlags.Absolute + } + }; + inputs.Add(input); + } + else if (locationType == LocationType.RandomRange) + { + Win32.INPUT input = new Win32.INPUT + { + type = Win32.SendInputEventType.InputMouse, + mi = new Win32.MOUSEINPUT + { + dx = Win32.CalculateAbsoluteCoordinateX(rnd.Next(x, x + width)), + dy = Win32.CalculateAbsoluteCoordinateX(rnd.Next(y, y + height)), + dwFlags = Win32.MouseEventFlags.Move | Win32.MouseEventFlags.Absolute + } + }; + inputs.Add(input); + } + //System.Diagnostics.Debug.Print("Move command added"); + + // マウスをクリック + for (int i = 0; i < (doubleClick ? 2 : 1); i++) + { + // Add a delay if it's a double click. + if (i == 1) + { + Thread.Sleep(50); + } + + if (buttonType == ButtonType.Left) + { + Win32.INPUT inputDown = new Win32.INPUT + { + type = Win32.SendInputEventType.InputMouse, + mi = new Win32.MOUSEINPUT + { + dwFlags = Win32.MouseEventFlags.LeftDown + } + }; + inputs.Add(inputDown); + Win32.INPUT inputUp = new Win32.INPUT + { + type = Win32.SendInputEventType.InputMouse, + mi = new Win32.MOUSEINPUT + { + dwFlags = Win32.MouseEventFlags.LeftUp + } + }; + inputs.Add(inputUp); + } + + if (buttonType == ButtonType.Middle) + { + Win32.INPUT inputDown = new Win32.INPUT + { + type = Win32.SendInputEventType.InputMouse, + mi = new Win32.MOUSEINPUT + { + dwFlags = Win32.MouseEventFlags.MiddleDown + } + }; + inputs.Add(inputDown); + Win32.INPUT inputUp = new Win32.INPUT + { + type = Win32.SendInputEventType.InputMouse, + mi = new Win32.MOUSEINPUT + { + dwFlags = Win32.MouseEventFlags.MiddleUp + } + }; + inputs.Add(inputUp); + } + + if (buttonType == ButtonType.Right) + { + Win32.INPUT inputDown = new Win32.INPUT + { + type = Win32.SendInputEventType.InputMouse, + mi = new Win32.MOUSEINPUT + { + dwFlags = Win32.MouseEventFlags.RightDown + } + }; + inputs.Add(inputDown); + Win32.INPUT inputUp = new Win32.INPUT + { + type = Win32.SendInputEventType.InputMouse, + mi = new Win32.MOUSEINPUT + { + dwFlags = Win32.MouseEventFlags.RightUp + } + }; + inputs.Add(inputUp); + } + } + //System.Diagnostics.Debug.Print("Click commands added"); + + //INPUT[] input = new INPUT[2]; + //input[0].mi.dwFlags = Win32.MOUSEEVENTF_LEFTDOWN; + //input[1].mi.dwFlags = Win32.MOUSEEVENTF_LEFTUP; + //Win32.SendInput(2, input, Marshal.SizeOf(input[0])); + Win32.SendInput((uint)inputs.Count, inputs.ToArray(), Marshal.SizeOf(new Win32.INPUT())); + //System.Diagnostics.Debug.Print("Command sent"); + + // ちょっと寝る + if (delayType == DelayType.Fixed) + { + Thread.Sleep(delay); + } + else + { + Thread.Sleep(rnd.Next(delay, delayRange)); + } + //System.Diagnostics.Debug.Print("Had a nap"); + remaining--; + } + } + + public bool IsAlive + { + get + { + if (Clicker == null) + { + return false; + } + return Clicker.IsAlive; + } + } + + public void Start() + { + Clicker = new Thread(Click); + Clicker.IsBackground = true; + Clicker.Start(); + } + + public void Stop() + { + if (Clicker != null) + { + Clicker.Abort(); + } + } + + private void SyncSettings() + { + if (buttonUpdated) + { + buttonType = tmpButtonType; + doubleClick = tmpDoubleClick; + + buttonUpdated = false; + } + + if (locationUpdated) + { + locationType = tmpLocationType; + x = tmpX; + y = tmpY; + width = tmpWidth; + height = tmpHeight; + + locationUpdated = false; + } + + if (delayUpdated) + { + delayType = tmpDelayType; + delay = tmpDelay; + delayRange = tmpDelayRange; + + delayUpdated = false; + } + + if (countUpdated) + { + countType = tmpCountType; + count = tmpCount; + + countUpdated = false; + } + //System.Diagnostics.Debug.Print("Settings synced"); + } + + public void UpdateButton(ButtonType ButtonType, bool DoubleClick) + { + tmpButtonType = ButtonType; + tmpDoubleClick = DoubleClick; + + buttonUpdated = true; + } + + public void UpdateLocation(LocationType LocationType, int X, int Y, int Width, int Height) + { + tmpLocationType = LocationType; + tmpX = X; + tmpY = Y; + tmpWidth = Width; + tmpHeight = Height; + + locationUpdated = true; + } + + public void UpdateDelay(DelayType DelayType, int Delay, int DelayRange) + { + tmpDelayType = DelayType; + tmpDelay = Delay; + tmpDelayRange = DelayRange; + + delayUpdated = true; + } + + public void UpdateCount(CountType CountType, int Count) + { + tmpCountType = CountType; + tmpCount = Count; + + countUpdated = true; + } + } +} diff --git a/AutoClicker/AutoClicker.csproj b/AutoClicker/AutoClicker.csproj new file mode 100644 index 0000000..24401a0 --- /dev/null +++ b/AutoClicker/AutoClicker.csproj @@ -0,0 +1,95 @@ + + + + + Debug + AnyCPU + {E9F5559C-E09D-4CAF-B8C7-3D255D804B28} + WinExe + Properties + AutoClicker + AutoClicker + v4.0 + 512 + true + + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + Form + + + MainForm.cs + + + + + + MainForm.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + True + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + + \ No newline at end of file diff --git a/AutoClicker/KeysConverter.cs b/AutoClicker/KeysConverter.cs new file mode 100644 index 0000000..798c56f --- /dev/null +++ b/AutoClicker/KeysConverter.cs @@ -0,0 +1,271 @@ + +using System.Text; +using System.Windows.Forms; + +namespace AutoClicker +{ + public class KeysConverter + { + public static string Convert(Keys keys) + { + return ConvertModifiers(keys) + " " + ConvertKeyPart(keys); + } + + public static string ConvertModifiers(Keys keys) + { + // Trim off the keys. + var trimmedKeys = (keys & Keys.Modifiers); + + StringBuilder output = new StringBuilder(); + + if ((trimmedKeys & Keys.Shift) != 0) + { + output.Append(" "); + } + + if ((trimmedKeys & Keys.Control) != 0) + { + output.Append(" "); + } + + if ((trimmedKeys & Keys.Alt) != 0) + { + output.Append(" "); + } + + string outString = output.ToString(); + if (outString.Length > 0) + { + // Trim the space off. + return outString.Substring(0, outString.Length - 1); + } + return ""; + } + + public static string ConvertKeyPart(Keys keys) + { + // Trim off the modifiers. + var trimmedKeys = (keys & Keys.KeyCode); + + switch (trimmedKeys) + { + case Keys.Back: + return "Backspace"; + case Keys.Tab: + return "Tab"; + case Keys.Return: + return "Enter"; + case Keys.Pause: + return "Pause"; + case Keys.Capital: + return "Caps Lock"; + case Keys.Escape: + return "Escape"; + case Keys.Space: + return "Space"; + case Keys.PageUp: + return "Page Up"; + case Keys.PageDown: + return "Page Down"; + case Keys.End: + return "End"; + case Keys.Home: + return "Home"; + case Keys.Left: + return "Left"; + case Keys.Up: + return "Up"; + case Keys.Right: + return "Right"; + case Keys.Down: + return "Down"; + case Keys.PrintScreen: + return "Print Screen"; + case Keys.Insert: + return "Insert"; + case Keys.Delete: + return "Delete"; + case Keys.D0: + return "0"; + case Keys.D1: + return "1"; + case Keys.D2: + return "2"; + case Keys.D3: + return "3"; + case Keys.D4: + return "4"; + case Keys.D5: + return "5"; + case Keys.D6: + return "6"; + case Keys.D7: + return "7"; + case Keys.D8: + return "8"; + case Keys.D9: + return "9"; + case Keys.A: + return "A"; + case Keys.B: + return "B"; + case Keys.C: + return "C"; + case Keys.D: + return "D"; + case Keys.E: + return "E"; + case Keys.F: + return "F"; + case Keys.G: + return "G"; + case Keys.H: + return "H"; + case Keys.I: + return "I"; + case Keys.J: + return "J"; + case Keys.K: + return "K"; + case Keys.L: + return "L"; + case Keys.M: + return "M"; + case Keys.N: + return "N"; + case Keys.O: + return "O"; + case Keys.P: + return "P"; + case Keys.Q: + return "Q"; + case Keys.R: + return "R"; + case Keys.S: + return "S"; + case Keys.T: + return "T"; + case Keys.U: + return "U"; + case Keys.V: + return "V"; + case Keys.W: + return "W"; + case Keys.X: + return "X"; + case Keys.Y: + return "Y"; + case Keys.Z: + return "Z"; + case Keys.NumPad0: + return "Num 0"; + case Keys.NumPad1: + return "Num 1"; + case Keys.NumPad2: + return "Num 2"; + case Keys.NumPad3: + return "Num 3"; + case Keys.NumPad4: + return "Num 4"; + case Keys.NumPad5: + return "Num 5"; + case Keys.NumPad6: + return "Num 6"; + case Keys.NumPad7: + return "Num 7"; + case Keys.NumPad8: + return "Num 8"; + case Keys.NumPad9: + return "Num 9"; + case Keys.Multiply: + return "Num *"; + case Keys.Add: + return "Num +"; + case Keys.Subtract: + return "Num -"; + case Keys.Decimal: + return "Num ."; + case Keys.Divide: + return "Num /"; + case Keys.F1: + return "F1"; + case Keys.F2: + return "F2"; + case Keys.F3: + return "F3"; + case Keys.F4: + return "F4"; + case Keys.F5: + return "F5"; + case Keys.F6: + return "F6"; + case Keys.F7: + return "F7"; + case Keys.F8: + return "F8"; + case Keys.F9: + return "F9"; + case Keys.F10: + return "F10"; + case Keys.F11: + return "F11"; + case Keys.F12: + return "F12"; + case Keys.F13: + return "F13"; + case Keys.F14: + return "F14"; + case Keys.F15: + return "F15"; + case Keys.F16: + return "F16"; + case Keys.F17: + return "F17"; + case Keys.F18: + return "F18"; + case Keys.F19: + return "F19"; + case Keys.F20: + return "F20"; + case Keys.F21: + return "F21"; + case Keys.F22: + return "F22"; + case Keys.F23: + return "F23"; + case Keys.F24: + return "F24"; + case Keys.NumLock: + return "Num Lock"; + case Keys.Scroll: + return "Scroll Lock"; + case Keys.OemSemicolon: + return ";"; + case Keys.Oemplus: + return "+"; + case Keys.Oemcomma: + return ","; + case Keys.OemMinus: + return "-"; + case Keys.OemPeriod: + return "."; + case Keys.OemQuestion: + return "?"; + case Keys.Oemtilde: + return "`"; + case Keys.OemOpenBrackets: + return "["; + case Keys.OemPipe: + return "|"; + case Keys.OemCloseBrackets: + return "]"; + case Keys.OemQuotes: + return "'"; + case Keys.OemBackslash: + return "\\"; + default: + return "Dunno"; + } + } + } +} diff --git a/AutoClicker/MainForm.Designer.cs b/AutoClicker/MainForm.Designer.cs new file mode 100644 index 0000000..c788029 --- /dev/null +++ b/AutoClicker/MainForm.Designer.cs @@ -0,0 +1,748 @@ +namespace AutoClicker +{ + partial class MainForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.grpMain = new System.Windows.Forms.GroupBox(); + this.grpClickType = new System.Windows.Forms.GroupBox(); + this.rdbClickDoubleRight = new System.Windows.Forms.RadioButton(); + this.rdbClickDoubleMiddle = new System.Windows.Forms.RadioButton(); + this.rdbClickDoubleLeft = new System.Windows.Forms.RadioButton(); + this.rdbClickSingleRight = new System.Windows.Forms.RadioButton(); + this.rdbClickSingleMiddle = new System.Windows.Forms.RadioButton(); + this.rdbClickSingleLeft = new System.Windows.Forms.RadioButton(); + this.grpControls = new System.Windows.Forms.GroupBox(); + this.label11 = new System.Windows.Forms.Label(); + this.btnToggle = new System.Windows.Forms.Button(); + this.btnHotkeyRemove = new System.Windows.Forms.Button(); + this.txtHotkey = new System.Windows.Forms.TextBox(); + this.grpCount = new System.Windows.Forms.GroupBox(); + this.label1 = new System.Windows.Forms.Label(); + this.numCount = new System.Windows.Forms.NumericUpDown(); + this.rdbCount = new System.Windows.Forms.RadioButton(); + this.rdbUntilStopped = new System.Windows.Forms.RadioButton(); + this.grpDelay = new System.Windows.Forms.GroupBox(); + this.label10 = new System.Windows.Forms.Label(); + this.label9 = new System.Windows.Forms.Label(); + this.numDelayFixed = new System.Windows.Forms.NumericUpDown(); + this.label8 = new System.Windows.Forms.Label(); + this.numDelayRangeMax = new System.Windows.Forms.NumericUpDown(); + this.numDelayRangeMin = new System.Windows.Forms.NumericUpDown(); + this.rdbDelayRange = new System.Windows.Forms.RadioButton(); + this.rdbDelayFixed = new System.Windows.Forms.RadioButton(); + this.grpLocation = new System.Windows.Forms.GroupBox(); + this.label6 = new System.Windows.Forms.Label(); + this.numRandomHeight = new System.Windows.Forms.NumericUpDown(); + this.label7 = new System.Windows.Forms.Label(); + this.numRandomWidth = new System.Windows.Forms.NumericUpDown(); + this.label4 = new System.Windows.Forms.Label(); + this.numRandomY = new System.Windows.Forms.NumericUpDown(); + this.label5 = new System.Windows.Forms.Label(); + this.numRandomX = new System.Windows.Forms.NumericUpDown(); + this.label3 = new System.Windows.Forms.Label(); + this.numFixedY = new System.Windows.Forms.NumericUpDown(); + this.label2 = new System.Windows.Forms.Label(); + this.numFixedX = new System.Windows.Forms.NumericUpDown(); + this.rdbLocationRandomArea = new System.Windows.Forms.RadioButton(); + this.rdbLocationFixed = new System.Windows.Forms.RadioButton(); + this.rdbLocationRandom = new System.Windows.Forms.RadioButton(); + this.rdbLocationMouse = new System.Windows.Forms.RadioButton(); + this.statusStrip1 = new System.Windows.Forms.StatusStrip(); + this.tslStatus = new System.Windows.Forms.ToolStripStatusLabel(); + this.grpMain.SuspendLayout(); + this.grpClickType.SuspendLayout(); + this.grpControls.SuspendLayout(); + this.grpCount.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numCount)).BeginInit(); + this.grpDelay.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numDelayFixed)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.numDelayRangeMax)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.numDelayRangeMin)).BeginInit(); + this.grpLocation.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numRandomHeight)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.numRandomWidth)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.numRandomY)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.numRandomX)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.numFixedY)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.numFixedX)).BeginInit(); + this.statusStrip1.SuspendLayout(); + this.SuspendLayout(); + // + // grpMain + // + this.grpMain.Controls.Add(this.grpClickType); + this.grpMain.Controls.Add(this.grpControls); + this.grpMain.Controls.Add(this.grpCount); + this.grpMain.Controls.Add(this.grpDelay); + this.grpMain.Controls.Add(this.grpLocation); + this.grpMain.Location = new System.Drawing.Point(12, 12); + this.grpMain.Name = "grpMain"; + this.grpMain.Size = new System.Drawing.Size(750, 287); + this.grpMain.TabIndex = 0; + this.grpMain.TabStop = false; + this.grpMain.Text = "Click details"; + // + // grpClickType + // + this.grpClickType.Controls.Add(this.rdbClickDoubleRight); + this.grpClickType.Controls.Add(this.rdbClickDoubleMiddle); + this.grpClickType.Controls.Add(this.rdbClickDoubleLeft); + this.grpClickType.Controls.Add(this.rdbClickSingleRight); + this.grpClickType.Controls.Add(this.rdbClickSingleMiddle); + this.grpClickType.Controls.Add(this.rdbClickSingleLeft); + this.grpClickType.Location = new System.Drawing.Point(353, 97); + this.grpClickType.Name = "grpClickType"; + this.grpClickType.Size = new System.Drawing.Size(391, 103); + this.grpClickType.TabIndex = 2; + this.grpClickType.TabStop = false; + this.grpClickType.Text = "Click type"; + // + // rdbClickDoubleRight + // + this.rdbClickDoubleRight.AutoSize = true; + this.rdbClickDoubleRight.Location = new System.Drawing.Point(100, 62); + this.rdbClickDoubleRight.Name = "rdbClickDoubleRight"; + this.rdbClickDoubleRight.Size = new System.Drawing.Size(89, 16); + this.rdbClickDoubleRight.TabIndex = 5; + this.rdbClickDoubleRight.Text = "Right Double"; + this.rdbClickDoubleRight.UseVisualStyleBackColor = true; + this.rdbClickDoubleRight.CheckedChanged += new System.EventHandler(this.ClickTypeHandler); + // + // rdbClickDoubleMiddle + // + this.rdbClickDoubleMiddle.AutoSize = true; + this.rdbClickDoubleMiddle.Location = new System.Drawing.Point(100, 40); + this.rdbClickDoubleMiddle.Name = "rdbClickDoubleMiddle"; + this.rdbClickDoubleMiddle.Size = new System.Drawing.Size(95, 16); + this.rdbClickDoubleMiddle.TabIndex = 4; + this.rdbClickDoubleMiddle.Text = "Middle Double"; + this.rdbClickDoubleMiddle.UseVisualStyleBackColor = true; + this.rdbClickDoubleMiddle.CheckedChanged += new System.EventHandler(this.ClickTypeHandler); + // + // rdbClickDoubleLeft + // + this.rdbClickDoubleLeft.AutoSize = true; + this.rdbClickDoubleLeft.Location = new System.Drawing.Point(100, 18); + this.rdbClickDoubleLeft.Name = "rdbClickDoubleLeft"; + this.rdbClickDoubleLeft.Size = new System.Drawing.Size(82, 16); + this.rdbClickDoubleLeft.TabIndex = 3; + this.rdbClickDoubleLeft.Text = "Left Double"; + this.rdbClickDoubleLeft.UseVisualStyleBackColor = true; + this.rdbClickDoubleLeft.CheckedChanged += new System.EventHandler(this.ClickTypeHandler); + // + // rdbClickSingleRight + // + this.rdbClickSingleRight.AutoSize = true; + this.rdbClickSingleRight.Location = new System.Drawing.Point(6, 62); + this.rdbClickSingleRight.Name = "rdbClickSingleRight"; + this.rdbClickSingleRight.Size = new System.Drawing.Size(50, 16); + this.rdbClickSingleRight.TabIndex = 2; + this.rdbClickSingleRight.Text = "Right"; + this.rdbClickSingleRight.UseVisualStyleBackColor = true; + this.rdbClickSingleRight.CheckedChanged += new System.EventHandler(this.ClickTypeHandler); + // + // rdbClickSingleMiddle + // + this.rdbClickSingleMiddle.AutoSize = true; + this.rdbClickSingleMiddle.Location = new System.Drawing.Point(6, 40); + this.rdbClickSingleMiddle.Name = "rdbClickSingleMiddle"; + this.rdbClickSingleMiddle.Size = new System.Drawing.Size(56, 16); + this.rdbClickSingleMiddle.TabIndex = 1; + this.rdbClickSingleMiddle.Text = "Middle"; + this.rdbClickSingleMiddle.UseVisualStyleBackColor = true; + this.rdbClickSingleMiddle.CheckedChanged += new System.EventHandler(this.ClickTypeHandler); + // + // rdbClickSingleLeft + // + this.rdbClickSingleLeft.AutoSize = true; + this.rdbClickSingleLeft.Checked = true; + this.rdbClickSingleLeft.Location = new System.Drawing.Point(6, 18); + this.rdbClickSingleLeft.Name = "rdbClickSingleLeft"; + this.rdbClickSingleLeft.Size = new System.Drawing.Size(43, 16); + this.rdbClickSingleLeft.TabIndex = 0; + this.rdbClickSingleLeft.TabStop = true; + this.rdbClickSingleLeft.Text = "Left"; + this.rdbClickSingleLeft.UseVisualStyleBackColor = true; + this.rdbClickSingleLeft.CheckedChanged += new System.EventHandler(this.ClickTypeHandler); + // + // grpControls + // + this.grpControls.Controls.Add(this.label11); + this.grpControls.Controls.Add(this.btnToggle); + this.grpControls.Controls.Add(this.btnHotkeyRemove); + this.grpControls.Controls.Add(this.txtHotkey); + this.grpControls.Location = new System.Drawing.Point(353, 18); + this.grpControls.Name = "grpControls"; + this.grpControls.Size = new System.Drawing.Size(391, 73); + this.grpControls.TabIndex = 1; + this.grpControls.TabStop = false; + this.grpControls.Text = "Controls"; + // + // label11 + // + this.label11.AutoSize = true; + this.label11.Location = new System.Drawing.Point(6, 21); + this.label11.Name = "label11"; + this.label11.Size = new System.Drawing.Size(41, 12); + this.label11.TabIndex = 4; + this.label11.Text = "Hotkey"; + // + // btnToggle + // + this.btnToggle.Location = new System.Drawing.Point(310, 44); + this.btnToggle.Name = "btnToggle"; + this.btnToggle.Size = new System.Drawing.Size(75, 23); + this.btnToggle.TabIndex = 3; + this.btnToggle.Text = "Start"; + this.btnToggle.UseVisualStyleBackColor = true; + this.btnToggle.Click += new System.EventHandler(this.btnToggle_Click); + // + // btnHotkeyRemove + // + this.btnHotkeyRemove.Location = new System.Drawing.Point(229, 15); + this.btnHotkeyRemove.Name = "btnHotkeyRemove"; + this.btnHotkeyRemove.Size = new System.Drawing.Size(156, 23); + this.btnHotkeyRemove.TabIndex = 2; + this.btnHotkeyRemove.Text = "Clear Hotkey"; + this.btnHotkeyRemove.UseVisualStyleBackColor = true; + this.btnHotkeyRemove.Click += new System.EventHandler(this.btnHotkeyRemove_Click); + // + // txtHotkey + // + this.txtHotkey.Location = new System.Drawing.Point(8, 46); + this.txtHotkey.Name = "txtHotkey"; + this.txtHotkey.Size = new System.Drawing.Size(296, 19); + this.txtHotkey.TabIndex = 0; + this.txtHotkey.Text = "None"; + this.txtHotkey.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtHotkey_KeyDown); + // + // grpCount + // + this.grpCount.Controls.Add(this.label1); + this.grpCount.Controls.Add(this.numCount); + this.grpCount.Controls.Add(this.rdbCount); + this.grpCount.Controls.Add(this.rdbUntilStopped); + this.grpCount.Location = new System.Drawing.Point(6, 206); + this.grpCount.Name = "grpCount"; + this.grpCount.Size = new System.Drawing.Size(341, 69); + this.grpCount.TabIndex = 1; + this.grpCount.TabStop = false; + this.grpCount.Text = "Count"; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(230, 43); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(35, 12); + this.label1.TabIndex = 3; + this.label1.Text = "clicks"; + // + // numCount + // + this.numCount.Location = new System.Drawing.Point(104, 41); + this.numCount.Maximum = new decimal(new int[] { + 1000000, + 0, + 0, + 0}); + this.numCount.Name = "numCount"; + this.numCount.Size = new System.Drawing.Size(120, 19); + this.numCount.TabIndex = 2; + this.numCount.Value = new decimal(new int[] { + 100, + 0, + 0, + 0}); + this.numCount.ValueChanged += new System.EventHandler(this.CountHandler); + // + // rdbCount + // + this.rdbCount.AutoSize = true; + this.rdbCount.Location = new System.Drawing.Point(6, 41); + this.rdbCount.Name = "rdbCount"; + this.rdbCount.Size = new System.Drawing.Size(92, 16); + this.rdbCount.TabIndex = 1; + this.rdbCount.Text = "Fixed number"; + this.rdbCount.UseVisualStyleBackColor = true; + this.rdbCount.CheckedChanged += new System.EventHandler(this.CountHandler); + // + // rdbUntilStopped + // + this.rdbUntilStopped.AutoSize = true; + this.rdbUntilStopped.Checked = true; + this.rdbUntilStopped.Location = new System.Drawing.Point(6, 19); + this.rdbUntilStopped.Name = "rdbUntilStopped"; + this.rdbUntilStopped.Size = new System.Drawing.Size(91, 16); + this.rdbUntilStopped.TabIndex = 0; + this.rdbUntilStopped.TabStop = true; + this.rdbUntilStopped.Text = "Until stopped"; + this.rdbUntilStopped.UseVisualStyleBackColor = true; + this.rdbUntilStopped.CheckedChanged += new System.EventHandler(this.CountHandler); + // + // grpDelay + // + this.grpDelay.Controls.Add(this.label10); + this.grpDelay.Controls.Add(this.label9); + this.grpDelay.Controls.Add(this.numDelayFixed); + this.grpDelay.Controls.Add(this.label8); + this.grpDelay.Controls.Add(this.numDelayRangeMax); + this.grpDelay.Controls.Add(this.numDelayRangeMin); + this.grpDelay.Controls.Add(this.rdbDelayRange); + this.grpDelay.Controls.Add(this.rdbDelayFixed); + this.grpDelay.Location = new System.Drawing.Point(353, 206); + this.grpDelay.Name = "grpDelay"; + this.grpDelay.Size = new System.Drawing.Size(391, 69); + this.grpDelay.TabIndex = 1; + this.grpDelay.TabStop = false; + this.grpDelay.Text = "Delay"; + // + // label10 + // + this.label10.AutoSize = true; + this.label10.Location = new System.Drawing.Point(365, 45); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(20, 12); + this.label10.TabIndex = 13; + this.label10.Text = "ms"; + // + // label9 + // + this.label9.AutoSize = true; + this.label9.Location = new System.Drawing.Point(222, 20); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(20, 12); + this.label9.TabIndex = 12; + this.label9.Text = "ms"; + // + // numDelayFixed + // + this.numDelayFixed.Location = new System.Drawing.Point(96, 18); + this.numDelayFixed.Maximum = new decimal(new int[] { + 1000000, + 0, + 0, + 0}); + this.numDelayFixed.Name = "numDelayFixed"; + this.numDelayFixed.Size = new System.Drawing.Size(120, 19); + this.numDelayFixed.TabIndex = 11; + this.numDelayFixed.Value = new decimal(new int[] { + 100, + 0, + 0, + 0}); + this.numDelayFixed.ValueChanged += new System.EventHandler(this.DelayHandler); + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Location = new System.Drawing.Point(222, 45); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(11, 12); + this.label8.TabIndex = 10; + this.label8.Text = "-"; + // + // numDelayRangeMax + // + this.numDelayRangeMax.Location = new System.Drawing.Point(239, 43); + this.numDelayRangeMax.Maximum = new decimal(new int[] { + 1000000, + 0, + 0, + 0}); + this.numDelayRangeMax.Name = "numDelayRangeMax"; + this.numDelayRangeMax.Size = new System.Drawing.Size(120, 19); + this.numDelayRangeMax.TabIndex = 9; + this.numDelayRangeMax.Value = new decimal(new int[] { + 1000, + 0, + 0, + 0}); + this.numDelayRangeMax.ValueChanged += new System.EventHandler(this.DelayHandler); + // + // numDelayRangeMin + // + this.numDelayRangeMin.Location = new System.Drawing.Point(96, 43); + this.numDelayRangeMin.Maximum = new decimal(new int[] { + 1000000, + 0, + 0, + 0}); + this.numDelayRangeMin.Name = "numDelayRangeMin"; + this.numDelayRangeMin.Size = new System.Drawing.Size(120, 19); + this.numDelayRangeMin.TabIndex = 8; + this.numDelayRangeMin.Value = new decimal(new int[] { + 500, + 0, + 0, + 0}); + this.numDelayRangeMin.ValueChanged += new System.EventHandler(this.DelayHandler); + // + // rdbDelayRange + // + this.rdbDelayRange.AutoSize = true; + this.rdbDelayRange.Location = new System.Drawing.Point(6, 43); + this.rdbDelayRange.Name = "rdbDelayRange"; + this.rdbDelayRange.Size = new System.Drawing.Size(84, 16); + this.rdbDelayRange.TabIndex = 1; + this.rdbDelayRange.Text = "Delay range"; + this.rdbDelayRange.UseVisualStyleBackColor = true; + this.rdbDelayRange.CheckedChanged += new System.EventHandler(this.DelayHandler); + // + // rdbDelayFixed + // + this.rdbDelayFixed.AutoSize = true; + this.rdbDelayFixed.Checked = true; + this.rdbDelayFixed.Location = new System.Drawing.Point(6, 18); + this.rdbDelayFixed.Name = "rdbDelayFixed"; + this.rdbDelayFixed.Size = new System.Drawing.Size(82, 16); + this.rdbDelayFixed.TabIndex = 0; + this.rdbDelayFixed.TabStop = true; + this.rdbDelayFixed.Text = "Fixed delay"; + this.rdbDelayFixed.UseVisualStyleBackColor = true; + this.rdbDelayFixed.CheckedChanged += new System.EventHandler(this.DelayHandler); + // + // grpLocation + // + this.grpLocation.Controls.Add(this.label6); + this.grpLocation.Controls.Add(this.numRandomHeight); + this.grpLocation.Controls.Add(this.label7); + this.grpLocation.Controls.Add(this.numRandomWidth); + this.grpLocation.Controls.Add(this.label4); + this.grpLocation.Controls.Add(this.numRandomY); + this.grpLocation.Controls.Add(this.label5); + this.grpLocation.Controls.Add(this.numRandomX); + this.grpLocation.Controls.Add(this.label3); + this.grpLocation.Controls.Add(this.numFixedY); + this.grpLocation.Controls.Add(this.label2); + this.grpLocation.Controls.Add(this.numFixedX); + this.grpLocation.Controls.Add(this.rdbLocationRandomArea); + this.grpLocation.Controls.Add(this.rdbLocationFixed); + this.grpLocation.Controls.Add(this.rdbLocationRandom); + this.grpLocation.Controls.Add(this.rdbLocationMouse); + this.grpLocation.Location = new System.Drawing.Point(6, 18); + this.grpLocation.Name = "grpLocation"; + this.grpLocation.Size = new System.Drawing.Size(341, 182); + this.grpLocation.TabIndex = 0; + this.grpLocation.TabStop = false; + this.grpLocation.Text = "Location"; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(171, 158); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(38, 12); + this.label6.TabIndex = 15; + this.label6.Text = "Height"; + // + // numRandomHeight + // + this.numRandomHeight.Location = new System.Drawing.Point(215, 156); + this.numRandomHeight.Maximum = new decimal(new int[] { + 1000000, + 0, + 0, + 0}); + this.numRandomHeight.Name = "numRandomHeight"; + this.numRandomHeight.Size = new System.Drawing.Size(120, 19); + this.numRandomHeight.TabIndex = 14; + this.numRandomHeight.Value = new decimal(new int[] { + 100, + 0, + 0, + 0}); + this.numRandomHeight.ValueChanged += new System.EventHandler(this.LocationHandler); + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Location = new System.Drawing.Point(6, 158); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(33, 12); + this.label7.TabIndex = 13; + this.label7.Text = "Width"; + // + // numRandomWidth + // + this.numRandomWidth.Location = new System.Drawing.Point(45, 156); + this.numRandomWidth.Maximum = new decimal(new int[] { + 1000000, + 0, + 0, + 0}); + this.numRandomWidth.Name = "numRandomWidth"; + this.numRandomWidth.Size = new System.Drawing.Size(120, 19); + this.numRandomWidth.TabIndex = 12; + this.numRandomWidth.Value = new decimal(new int[] { + 100, + 0, + 0, + 0}); + this.numRandomWidth.ValueChanged += new System.EventHandler(this.LocationHandler); + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(197, 133); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(12, 12); + this.label4.TabIndex = 11; + this.label4.Text = "Y"; + // + // numRandomY + // + this.numRandomY.Location = new System.Drawing.Point(215, 131); + this.numRandomY.Maximum = new decimal(new int[] { + 1000000, + 0, + 0, + 0}); + this.numRandomY.Name = "numRandomY"; + this.numRandomY.Size = new System.Drawing.Size(120, 19); + this.numRandomY.TabIndex = 10; + this.numRandomY.ValueChanged += new System.EventHandler(this.LocationHandler); + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(27, 133); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(12, 12); + this.label5.TabIndex = 9; + this.label5.Text = "X"; + // + // numRandomX + // + this.numRandomX.Location = new System.Drawing.Point(45, 131); + this.numRandomX.Maximum = new decimal(new int[] { + 1000000, + 0, + 0, + 0}); + this.numRandomX.Name = "numRandomX"; + this.numRandomX.Size = new System.Drawing.Size(120, 19); + this.numRandomX.TabIndex = 8; + this.numRandomX.ValueChanged += new System.EventHandler(this.LocationHandler); + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(197, 86); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(12, 12); + this.label3.TabIndex = 7; + this.label3.Text = "Y"; + // + // numFixedY + // + this.numFixedY.Location = new System.Drawing.Point(215, 84); + this.numFixedY.Maximum = new decimal(new int[] { + 1000000, + 0, + 0, + 0}); + this.numFixedY.Name = "numFixedY"; + this.numFixedY.Size = new System.Drawing.Size(120, 19); + this.numFixedY.TabIndex = 6; + this.numFixedY.ValueChanged += new System.EventHandler(this.LocationHandler); + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(27, 86); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(12, 12); + this.label2.TabIndex = 5; + this.label2.Text = "X"; + // + // numFixedX + // + this.numFixedX.Location = new System.Drawing.Point(45, 84); + this.numFixedX.Maximum = new decimal(new int[] { + 1000000, + 0, + 0, + 0}); + this.numFixedX.Name = "numFixedX"; + this.numFixedX.Size = new System.Drawing.Size(120, 19); + this.numFixedX.TabIndex = 4; + this.numFixedX.ValueChanged += new System.EventHandler(this.LocationHandler); + // + // rdbLocationRandomArea + // + this.rdbLocationRandomArea.AutoSize = true; + this.rdbLocationRandomArea.Location = new System.Drawing.Point(6, 109); + this.rdbLocationRandomArea.Name = "rdbLocationRandomArea"; + this.rdbLocationRandomArea.Size = new System.Drawing.Size(90, 16); + this.rdbLocationRandomArea.TabIndex = 3; + this.rdbLocationRandomArea.Text = "Random area"; + this.rdbLocationRandomArea.UseVisualStyleBackColor = true; + this.rdbLocationRandomArea.CheckedChanged += new System.EventHandler(this.LocationHandler); + // + // rdbLocationFixed + // + this.rdbLocationFixed.AutoSize = true; + this.rdbLocationFixed.Location = new System.Drawing.Point(6, 62); + this.rdbLocationFixed.Name = "rdbLocationFixed"; + this.rdbLocationFixed.Size = new System.Drawing.Size(95, 16); + this.rdbLocationFixed.TabIndex = 2; + this.rdbLocationFixed.Text = "Fixed location"; + this.rdbLocationFixed.UseVisualStyleBackColor = true; + this.rdbLocationFixed.CheckedChanged += new System.EventHandler(this.LocationHandler); + // + // rdbLocationRandom + // + this.rdbLocationRandom.AutoSize = true; + this.rdbLocationRandom.Location = new System.Drawing.Point(6, 40); + this.rdbLocationRandom.Name = "rdbLocationRandom"; + this.rdbLocationRandom.Size = new System.Drawing.Size(118, 16); + this.rdbLocationRandom.TabIndex = 1; + this.rdbLocationRandom.Text = "Random on screen"; + this.rdbLocationRandom.UseVisualStyleBackColor = true; + this.rdbLocationRandom.CheckedChanged += new System.EventHandler(this.LocationHandler); + // + // rdbLocationMouse + // + this.rdbLocationMouse.AutoSize = true; + this.rdbLocationMouse.Checked = true; + this.rdbLocationMouse.Location = new System.Drawing.Point(6, 18); + this.rdbLocationMouse.Name = "rdbLocationMouse"; + this.rdbLocationMouse.Size = new System.Drawing.Size(100, 16); + this.rdbLocationMouse.TabIndex = 0; + this.rdbLocationMouse.TabStop = true; + this.rdbLocationMouse.Text = "Mouse location"; + this.rdbLocationMouse.UseVisualStyleBackColor = true; + this.rdbLocationMouse.CheckedChanged += new System.EventHandler(this.LocationHandler); + // + // statusStrip1 + // + this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.tslStatus}); + this.statusStrip1.Location = new System.Drawing.Point(0, 310); + this.statusStrip1.Name = "statusStrip1"; + this.statusStrip1.Size = new System.Drawing.Size(774, 22); + this.statusStrip1.TabIndex = 1; + this.statusStrip1.Text = "statusStrip1"; + // + // tslStatus + // + this.tslStatus.Name = "tslStatus"; + this.tslStatus.Size = new System.Drawing.Size(279, 17); + this.tslStatus.Text = "Not currently doing much helpful here to be honest"; + // + // MainForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(774, 332); + this.Controls.Add(this.statusStrip1); + this.Controls.Add(this.grpMain); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.Name = "MainForm"; + this.Text = "Auto Clicker"; + this.Load += new System.EventHandler(this.Form1_Load); + this.grpMain.ResumeLayout(false); + this.grpClickType.ResumeLayout(false); + this.grpClickType.PerformLayout(); + this.grpControls.ResumeLayout(false); + this.grpControls.PerformLayout(); + this.grpCount.ResumeLayout(false); + this.grpCount.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numCount)).EndInit(); + this.grpDelay.ResumeLayout(false); + this.grpDelay.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numDelayFixed)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.numDelayRangeMax)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.numDelayRangeMin)).EndInit(); + this.grpLocation.ResumeLayout(false); + this.grpLocation.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numRandomHeight)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.numRandomWidth)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.numRandomY)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.numRandomX)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.numFixedY)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.numFixedX)).EndInit(); + this.statusStrip1.ResumeLayout(false); + this.statusStrip1.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.GroupBox grpMain; + private System.Windows.Forms.GroupBox grpClickType; + private System.Windows.Forms.GroupBox grpControls; + private System.Windows.Forms.Button btnHotkeyRemove; + private System.Windows.Forms.TextBox txtHotkey; + private System.Windows.Forms.GroupBox grpCount; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.NumericUpDown numCount; + private System.Windows.Forms.RadioButton rdbCount; + private System.Windows.Forms.RadioButton rdbUntilStopped; + private System.Windows.Forms.GroupBox grpDelay; + private System.Windows.Forms.Label label10; + private System.Windows.Forms.Label label9; + private System.Windows.Forms.NumericUpDown numDelayFixed; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.NumericUpDown numDelayRangeMax; + private System.Windows.Forms.NumericUpDown numDelayRangeMin; + private System.Windows.Forms.RadioButton rdbDelayRange; + private System.Windows.Forms.RadioButton rdbDelayFixed; + private System.Windows.Forms.GroupBox grpLocation; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.NumericUpDown numRandomHeight; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.NumericUpDown numRandomWidth; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.NumericUpDown numRandomY; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.NumericUpDown numRandomX; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.NumericUpDown numFixedY; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.NumericUpDown numFixedX; + private System.Windows.Forms.RadioButton rdbLocationRandomArea; + private System.Windows.Forms.RadioButton rdbLocationFixed; + private System.Windows.Forms.RadioButton rdbLocationRandom; + private System.Windows.Forms.RadioButton rdbLocationMouse; + private System.Windows.Forms.RadioButton rdbClickDoubleRight; + private System.Windows.Forms.RadioButton rdbClickDoubleMiddle; + private System.Windows.Forms.RadioButton rdbClickDoubleLeft; + private System.Windows.Forms.RadioButton rdbClickSingleRight; + private System.Windows.Forms.RadioButton rdbClickSingleMiddle; + private System.Windows.Forms.RadioButton rdbClickSingleLeft; + private System.Windows.Forms.StatusStrip statusStrip1; + private System.Windows.Forms.ToolStripStatusLabel tslStatus; + private System.Windows.Forms.Button btnToggle; + private System.Windows.Forms.Label label11; + } +} + diff --git a/AutoClicker/MainForm.cs b/AutoClicker/MainForm.cs new file mode 100644 index 0000000..a068439 --- /dev/null +++ b/AutoClicker/MainForm.cs @@ -0,0 +1,257 @@ +using System; +using System.Windows.Forms; + +namespace AutoClicker +{ + public partial class MainForm : Form + { + private AutoClicker clicker; + private Keys hotkey; + private Win32.fsModifiers modifiers; + private bool hotkeySet; + + public MainForm() + { + InitializeComponent(); + } + + private void Form1_Load(object sender, EventArgs e) + { + clicker = new AutoClicker(); + ClickTypeHandler(null, null); + LocationHandler(null, null); + DelayHandler(null, null); + CountHandler(null, null); + } + + private void ClickTypeHandler(object sender, EventArgs e) + { + AutoClicker.ButtonType buttonType; + bool doubleClick = false; + + if (rdbClickSingleLeft.Checked || rdbClickDoubleLeft.Checked) + { + buttonType = AutoClicker.ButtonType.Left; + } + else if (rdbClickSingleMiddle.Checked || rdbClickDoubleMiddle.Checked) + { + buttonType = AutoClicker.ButtonType.Middle; + } + else + { + buttonType = AutoClicker.ButtonType.Right; + } + + if (rdbClickDoubleLeft.Checked || rdbClickDoubleMiddle.Checked || rdbClickDoubleRight.Checked) + { + doubleClick = true; + } + + clicker.UpdateButton(buttonType, doubleClick); + } + + private void LocationHandler(object sender, EventArgs e) + { + AutoClicker.LocationType locationType; + int x = -1; + int y = -1; + int width = -1; + int height = -1; + + if (rdbLocationFixed.Checked) + { + locationType = AutoClicker.LocationType.Fixed; + x = (int)numFixedX.Value; + y = (int)numFixedY.Value; + } + else if (rdbLocationMouse.Checked) + { + locationType = AutoClicker.LocationType.Cursor; + } + else if (rdbLocationRandom.Checked) + { + locationType = AutoClicker.LocationType.Random; + } + else + { + locationType = AutoClicker.LocationType.RandomRange; + x = (int)numRandomX.Value; + y = (int)numRandomY.Value; + width = (int)numRandomWidth.Value; + height = (int)numRandomHeight.Value; + } + + // Toggle visibility of controls. + if (locationType == AutoClicker.LocationType.Fixed) + { + numFixedX.Enabled = true; + numFixedY.Enabled = true; + } + else + { + numFixedX.Enabled = false; + numFixedY.Enabled = false; + } + + if (locationType == AutoClicker.LocationType.RandomRange) + { + numRandomX.Enabled = true; + numRandomY.Enabled = true; + numRandomWidth.Enabled = true; + numRandomHeight.Enabled = true; + } + else + { + numRandomX.Enabled = false; + numRandomY.Enabled = false; + numRandomWidth.Enabled = false; + numRandomHeight.Enabled = false; + } + + clicker.UpdateLocation(locationType, x, y, width, height); + } + + private void DelayHandler(object sender, EventArgs e) + { + AutoClicker.DelayType delayType; + int delay = -1; + int delayRange = -1; + + if (rdbDelayFixed.Checked) + { + delayType = AutoClicker.DelayType.Fixed; + delay = (int)numDelayFixed.Value; + } + else + { + delayType = AutoClicker.DelayType.Range; + delay = (int)numDelayRangeMin.Value; + delayRange = (int)numDelayRangeMax.Value; + } + + // Toggle visibility of controls. + if (delayType == AutoClicker.DelayType.Fixed) + { + numDelayFixed.Enabled = true; + numDelayRangeMax.Enabled = false; + numDelayRangeMin.Enabled = false; + } + else + { + numDelayFixed.Enabled = false; + numDelayRangeMax.Enabled = true; + numDelayRangeMin.Enabled = true; + } + + clicker.UpdateDelay(delayType, delay, delayRange); + } + + private void CountHandler(object sender, EventArgs e) + { + AutoClicker.CountType countType; + int count = -1; + + if (rdbCount.Checked) + { + countType = AutoClicker.CountType.Fixed; + count = (int)numCount.Value; + } + else + { + countType = AutoClicker.CountType.UntilStopped; + } + + // Toggle visibility of controls. + if (countType == AutoClicker.CountType.Fixed) + { + numCount.Enabled = true; + } + else + { + numCount.Enabled = false; + } + + clicker.UpdateCount(countType, count); + } + + private void btnHotkeyRemove_Click(object sender, EventArgs e) + { + Win32.UnregisterHotKey(this.Handle, (int)hotkey); + hotkeySet = false; + btnHotkeyRemove.Enabled = false; + } + + private void btnToggle_Click(object sender, EventArgs e) + { + if (!clicker.IsAlive) + { + grpClickType.Enabled = false; + grpLocation.Enabled = false; + grpDelay.Enabled = false; + grpCount.Enabled = false; + clicker.Start(); + btnToggle.Text = "Stop"; + } + else + { + clicker.Stop(); + grpClickType.Enabled = true; + grpLocation.Enabled = true; + grpDelay.Enabled = true; + grpCount.Enabled = true; + btnToggle.Text = "Start"; + } + } + + protected override void WndProc(ref Message m) + { + base.WndProc(ref m); + + if (m.Msg == Win32.WM_HOTKEY) + { + // Ignore the hotkey if the user is editing it. + if (txtHotkey.Focused) + { + return; + } + + Keys key = (Keys)(((int)m.LParam >> 16) & 0xFFFF); + if (key == Keys.F2) + { + btnToggle_Click(null, null); + } + } + } + + private void txtHotkey_KeyDown(object sender, KeyEventArgs e) + { + e.SuppressKeyPress = true; + // Don't want to do anything if only a modifier key is pressed. + // Modifiers Asian keys (kana, hanja, kanji etc) IME related keys (convert etc) Korean alt (process) Windows keys + if (!((e.KeyValue >= 16 && e.KeyValue <= 18) || (e.KeyValue >= 21 && e.KeyValue <= 25) || (e.KeyValue >= 28 && e.KeyValue <= 31) || e.KeyValue == 229 || (e.KeyValue >= 91 && e.KeyValue <= 92))) + { + Win32.UnregisterHotKey(this.Handle, (int)hotkey); + txtHotkey.Text = KeysConverter.Convert(e.KeyData); + hotkey = e.KeyData; + // Extract modifiers + modifiers = 0; + if ((e.Modifiers & Keys.Shift) != 0) + { + modifiers |= Win32.fsModifiers.Shift; + } + if ((e.Modifiers & Keys.Control) != 0) + { + modifiers |= Win32.fsModifiers.Control; + } + if ((e.Modifiers & Keys.Alt) != 0) + { + modifiers |= Win32.fsModifiers.Alt; + } + + Win32.RegisterHotKey(this.Handle, (int)hotkey, (uint)modifiers, (uint)(hotkey & Keys.KeyCode)); + hotkeySet = true; + btnHotkeyRemove.Enabled = true; + } + } + } +} diff --git a/AutoClicker/MainForm.resx b/AutoClicker/MainForm.resx new file mode 100644 index 0000000..174ebc7 --- /dev/null +++ b/AutoClicker/MainForm.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + \ No newline at end of file diff --git a/AutoClicker/Program.cs b/AutoClicker/Program.cs new file mode 100644 index 0000000..6a458cf --- /dev/null +++ b/AutoClicker/Program.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace AutoClicker +{ + static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new MainForm()); + } + } +} diff --git a/AutoClicker/Properties/AssemblyInfo.cs b/AutoClicker/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..5d2c348 --- /dev/null +++ b/AutoClicker/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("AutoClicker")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("AutoClicker")] +[assembly: AssemblyCopyright("Copyright © 2015")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("e9f5559c-e09d-4caf-b8c7-3d255d804b28")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/AutoClicker/Properties/Resources.Designer.cs b/AutoClicker/Properties/Resources.Designer.cs new file mode 100644 index 0000000..2c8e0ac --- /dev/null +++ b/AutoClicker/Properties/Resources.Designer.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace AutoClicker.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AutoClicker.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/AutoClicker/Properties/Resources.resx b/AutoClicker/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/AutoClicker/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/AutoClicker/Properties/Settings.Designer.cs b/AutoClicker/Properties/Settings.Designer.cs new file mode 100644 index 0000000..a8b84fb --- /dev/null +++ b/AutoClicker/Properties/Settings.Designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace AutoClicker.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + } +} diff --git a/AutoClicker/Properties/Settings.settings b/AutoClicker/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/AutoClicker/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/AutoClicker/Win32.cs b/AutoClicker/Win32.cs new file mode 100644 index 0000000..fd6895e --- /dev/null +++ b/AutoClicker/Win32.cs @@ -0,0 +1,88 @@ +using System; +using System.Runtime.InteropServices; + +namespace AutoClicker +{ + public class Win32 + { + public const int WM_HOTKEY = 0x0312; + + public enum SendInputEventType + { + InputMouse = 0x0000, + InputKeyboard = 0x0001 + } + + public enum MouseEventFlags + { + Move = 0x0001, + LeftDown = 0x0002, + LeftUp = 0x0004, + RightDown = 0x0008, + RightUp = 0x0010, + MiddleDown = 0x0020, + MiddleUp = 0x0040, + Wheel = 0x0080, + XDown = 0x0100, + XUp = 0x0200, + Absolute = 0x8000 + } + + public enum SystemMetric + { + CXScreen = 0x0000, + CYScreen = 0x0001, + } + + public enum fsModifiers : uint + { + Alt = 0x0001, + Control = 0x0002, + Shift = 0x0004, + Windows = 0x0008, + NoRepeat = 0x4000 + } + + [StructLayout(LayoutKind.Sequential)] + public struct INPUT + { + public SendInputEventType type; // 0 = INPUT_MOUSE(デフォルト), 1 = INPUT_KEYBOARD + public MOUSEINPUT mi; + } + + [StructLayout(LayoutKind.Sequential)] + public struct MOUSEINPUT + { + public int dx; + public int dy; + public int mouseData; + public MouseEventFlags dwFlags; + public int time; + public IntPtr dwExtraInfo; + } + + [DllImport("user32.dll")] + public static extern bool UnregisterHotKey(IntPtr hWnd, int id); + [DllImport("user32.dll")] + public static extern bool RegisterHotKey(IntPtr hWnd, int id, uint fsModifiers, uint vk); + [DllImport("user32.dll")] + public static extern uint SendInput( + uint nInputs, // INPUT 構造体の数(イベント数) + INPUT[] pInputs, // INPUT 構造体 + int cbSize // INPUT 構造体のサイズ + ); + + [DllImport("user32.dll")] + public static extern int GetSystemMetrics(SystemMetric smIndex); + + public static int CalculateAbsoluteCoordinateX(int x) + { + return (x * 65536) / GetSystemMetrics(SystemMetric.CXScreen); + } + + public static int CalculateAbsoluteCoordinateY(int y) + { + return (y * 65536) / GetSystemMetrics(SystemMetric.CYScreen); + } + } +} diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..8f484a8 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 helifreak + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..e97286f --- /dev/null +++ b/README.md @@ -0,0 +1,10 @@ +# Auto Clicker +Automatically clicks the mouse for you. + +# Features +- Click where the cursor is, a specfied point, inside a box or just somewhere on the screen. +- Change interval or choose a random interval range. +- Left, Right, and MIDDLE clicks. Double click supported. +- Continue until stopped or after a number of clicks. +- Hotkey support with almost every key + Shift, Control, and Alt modifiers. +- Costs less than what I cloned. \ No newline at end of file