I started making an Auto clicker, with some new commands that I needed and used google to find, I finished it but its missing one thing..Hotkeys.
I need to make two hotkeys like F1 to start and F2 to stop, I didn't find any tutorial/commands how to make this.
Please teach me how can I make it alone (Tutorial), or link me a tutorial if you find.
I can't ask for a code tho..
Thank you
Here is the current code if needed:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
namespace MyFirstAutoClicker
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void StartAC_Click(object sender, EventArgs e)
{
timer1.Start();
}
private void StopAC_Click(object sender, EventArgs e)
{
timer1.Stop();
}
private void CountUp_Click(object sender, EventArgs e)
{
int x = int.Parse(CountLabel.Text);
if (x < 1000)
{
x++;
string newstr = x.ToString();
CountLabel.Text = newstr;
}
}
private void ResetCounter_Click(object sender, EventArgs e)
{
CountLabel.Text = "0";
}
private const int MOUSEEVENTF_LEFTDOWN = 0x0002;
private const int MOUSEEVENTF_LEFTUP = 0x0004;
[DllImport("user32.dll", CharSet = CharSet.Auto,CallingConvention = CallingConvention.StdCall)]
public static extern void mouse_event(int dwFlags, int dx, int dy, int cButtons,
int dwExtraInfo);
private void timer1_Tick(object sender, EventArgs e)
{
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
}
}
}
This post has been edited by Programmerz: 29 April 2009 - 02:53 AM

New Topic/Question
Reply




MultiQuote






|