Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
M

Marcin Rajczakowski

@Marcin Rajczakowski
About
Posts
1
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • How to make an inactive window work and respond to buttons (C# .NET windows forms)
    M Marcin Rajczakowski

    I have such a clicker, I want to be able to continue, for example, after opening another application, or vice versa. Please help All code here:

    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 Klikacz____TzPw
    {

    public partial class Form1 : Form
    {
        \[DllImport(dllName: "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 const int LEFTUP = 0x0004;
        private const int LEFTDOWN = 0x0002;
    
        public Form1()
        {
            InitializeComponent();
            this.ActiveControl = button1;
            button1.Focus();
        }
    
        private void Click\_clock\_Tick(object sender, EventArgs e)
        {
            Random rnd = new Random();
            int maxcps = (int)Math.Round(1000.0 / (trackBar1.Value + 0 \* 0.2));
            int mincps = (int)Math.Round(1000.0 / (trackBar1.Value + 0 \* 0.4));
    
            try
            {
                Click\_clock.Interval = rnd.Next(mincps, maxcps);
            }
    
            catch
            {
                //Ignored..
            }
    
            bool mousdown = MouseButtons == MouseButtons.Left;
            if (mousdown)
            {
                mouse\_event(dwFlags: LEFTUP, dx: 0, dy: 0, cButtons: 0, dwExtraInfo: 0);
                Thread.Sleep(millisecondsTimeout: rnd.Next(1, 6));
                mouse\_event(dwFlags: LEFTDOWN, dx: 0, dy: 0, cButtons: 0, dwExtraInfo: 0);
            }
    
        }
    
        private void button1\_Click(object sender, EventArgs e)
        {
            if (button1.Text.Contains("Uruchom"))
            {
                Click\_clock.Start();
                button1.Text = "Wstrzymaj";
            }
            else
            {
                Click\_clock.Stop();
                button1.Text = "Uruchom";
            }
        }
    
        private void trackBar1\_Scroll(object sender, EventArgs e)
        {
            CPSValue.Text = "CPS = " + trackBar1.Value.ToString();
        }
    }
    

    }

    C# csharp tutorial winforms linq graphics
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups