Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6852965
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:27:17+00:00 2026-05-27T01:27:17+00:00

Here is the original question but it is considered to java: Simulate mouse clicks

  • 0

Here is the original question but it is considered to java:
Simulate mouse clicks at a certain position on inactive window in Java?

Anyways, I’m building a bot to run in the background. This bot requires me to click. Of course, I want to be able to do other things while the bot is running.

So I was wondering if it was possible for me to simulate a mouse click at a certain position on an inactive window.

If this is possible, I would greatly appreciate it if any of you could help me.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T01:27:18+00:00Added an answer on May 27, 2026 at 1:27 am

    Yes it is possible, here’s the code I used for a previous school project:

    [System.Runtime.InteropServices.DllImport("user32.dll")]
    public static extern void mouse_event(int dwFlags, int dx, int dy, int cButtons, int dwExtraInfo);
    
    public const int MOUSEEVENTF_LEFTDOWN = 0x02;
    public const int MOUSEEVENTF_LEFTUP = 0x04;
    public const int MOUSEEVENTF_RIGHTDOWN = 0x08;
    public const int MOUSEEVENTF_RIGHTUP = 0x10;
    
    //This simulates a left mouse click
    public static void LeftMouseClick(Point position)
    {
        Cursor.Position = position;
        mouse_event(MOUSEEVENTF_LEFTDOWN, position.X, position.Y, 0, 0);
        mouse_event(MOUSEEVENTF_LEFTUP, position.X, position.Y, 0, 0);
    }
    

    EDIT : It seems that the mouse_event function was replaced by SendInput() but it still works (Windows 7 and earlier)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This question is sort of a follow-up to my original question here . Let's
Ok, here was my original question; Table one contains ID|Name 1 Mary 2 John
My original question can be found here , for which I've gotten some great
I am reposting this question due to inability to solve the problem (original here
EDIT: I figured out the answer to the original YUI3 question I posted here,
The answere is here, and my original question is below..... Changing the document workspace
I asked the original question here , and got a practical response with mixed
Basic question here, can I put String variables into a position in a string
OK, here was my original question, where I've left out the most important thing:
I know this question has been asked many times, but here are my specific

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.