Click here to Skip to main content
15,885,141 members
Home / Discussions / C#
   

C#

 
GeneralRe: C# and Excel don't work in a computer without Visual Studio Pin
Dave Kreskowiak26-Aug-21 5:08
mveDave Kreskowiak26-Aug-21 5:08 
GeneralRe: C# and Excel don't work in a computer without Visual Studio Pin
Ismael Oliveira 202126-Aug-21 19:46
Ismael Oliveira 202126-Aug-21 19:46 
AnswerRe: C# and Excel don't work in a computer without Visual Studio Pin
Dave Kreskowiak25-Aug-21 12:22
mveDave Kreskowiak25-Aug-21 12:22 
GeneralRe: C# and Excel don't work in a computer without Visual Studio Pin
Ismael Oliveira 202126-Aug-21 4:04
Ismael Oliveira 202126-Aug-21 4:04 
AnswerRe: C# and Excel don't work in a computer without Visual Studio Pin
Richard Andrew x6426-Aug-21 9:43
professionalRichard Andrew x6426-Aug-21 9:43 
QuestionSolve Web Service Error Pin
Luis M. Rojas24-Aug-21 2:43
Luis M. Rojas24-Aug-21 2:43 
AnswerRe: Solve Web Service Error Pin
Pete O'Hanlon24-Aug-21 10:18
mvePete O'Hanlon24-Aug-21 10:18 
QuestionHow to make an inactive window work and respond to buttons (C# .NET windows forms) Pin
Marcin Rajczakowski23-Aug-21 10:31
Marcin Rajczakowski23-Aug-21 10:31 
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();
        }
    }
}

AnswerRe: How to make an inactive window work and respond to buttons (C# .NET windows forms) Pin
BillWoodruff23-Aug-21 11:20
professionalBillWoodruff23-Aug-21 11:20 
GeneralInterfaces with code in them Pin
Rob Philpott20-Aug-21 0:22
Rob Philpott20-Aug-21 0:22 
GeneralRe: Interfaces with code in them Pin
Richard Deeming20-Aug-21 0:40
mveRichard Deeming20-Aug-21 0:40 
GeneralRe: Interfaces with code in them Pin
Rob Philpott20-Aug-21 0:55
Rob Philpott20-Aug-21 0:55 
GeneralRe: Interfaces with code in them Pin
pkfox29-Aug-21 22:46
professionalpkfox29-Aug-21 22:46 
GeneralRe: Interfaces with code in them Pin
Gerry Schmitz20-Aug-21 6:48
mveGerry Schmitz20-Aug-21 6:48 
Questionthere I thought the days of CreateParams were over ... observation (tip ?) Pin
BillWoodruff17-Aug-21 12:34
professionalBillWoodruff17-Aug-21 12:34 
AnswerRe: there I thought the days of CreateParams were over ... observation (tip ?) Pin
OriginalGriff19-Aug-21 9:02
mveOriginalGriff19-Aug-21 9:02 
GeneralRe: there I thought the days of CreateParams were over ... observation (tip ?) Pin
Richard Andrew x6419-Aug-21 9:26
professionalRichard Andrew x6419-Aug-21 9:26 
GeneralRe: there I thought the days of CreateParams were over ... observation (tip ?) Pin
BillWoodruff19-Aug-21 10:46
professionalBillWoodruff19-Aug-21 10:46 
QuestionSystem.IndexOutOfRangeException Pin
ProgrammerT216-Aug-21 23:36
ProgrammerT216-Aug-21 23:36 
AnswerRe: System.IndexOutOfRangeException Pin
Ralf Meier16-Aug-21 23:43
mveRalf Meier16-Aug-21 23:43 
AnswerRe: System.IndexOutOfRangeException Pin
OriginalGriff17-Aug-21 0:06
mveOriginalGriff17-Aug-21 0:06 
QuestionHow Linq determine the index of a list item? Pin
Alex Dunlop16-Aug-21 22:57
Alex Dunlop16-Aug-21 22:57 
AnswerRe: How Linq determine the index of a list item? Pin
Richard Deeming16-Aug-21 23:09
mveRichard Deeming16-Aug-21 23:09 
QuestionC# interacting with Excel Pin
Ismael Oliveira 202116-Aug-21 13:15
Ismael Oliveira 202116-Aug-21 13:15 
AnswerRe: C# interacting with Excel Pin
Richard Deeming16-Aug-21 21:36
mveRichard Deeming16-Aug-21 21:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.