Click here to Skip to main content
13,349,997 members (48,632 online)
Rate this:
Please Sign up or sign in to vote.
See more:
How we can make mouse click event in a certain position without moving mouse(I mean that make computer think a position is clicked with mouse) with C++
Posted 10-Sep-12 20:29pm
pwasser 11-Sep-12 1:34am
Did you try Google?
ZiDoM 11-Sep-12 2:43am
of course i always do that
pwasser 11-Sep-12 4:27am
Really, you perhaps need to spend some time learning how to do a Google search because the answer posted can be found in that way. Do you see where I'm going?
ZiDoM 11-Sep-12 4:34am
most of the search results are about changing the mouse position so because of that its hard to find my exact answer and yes i always need to learn if you have a good book or article about google search that i haven't seen yet i would like to read plz share
aspnet_regiis 11-Sep-12 5:30am
I found one for you. You MUST check it here
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

ZiDoM 11-Sep-12 3:26am
I used
but it clicks where the mouse is it doesn't click the position i told to click
pasztorpisti 21-Sep-12 5:46am
+5 works fine in a lot of cases, we are able to send the event to a specific application but this isn't a true equivalent of a real event. For example GetKeyState() will not work with this as expected.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2
ZiDoM 11-Sep-12 6:58am
mouse_event(MOUSEEVENTF_LEFTDOWN,813,731, 0, 0);
mouse_event(MOUSEEVENTF_LEFTUP,813,731, 0, 0);
doesn't work still it clicks the position the cursor is it doesn't click (813,731)
pasztorpisti 21-Sep-12 5:44am
+5 good solution if we don't care about which application receives the event
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

General windows environment mouse_event can click
However, in some games, their message loop with the windows are different,
You need to know that they are using directx or opengl or what graphics engine,
The only way to send the mouse to click on the message.
pasztorpisti 21-Sep-12 5:43am
+5 good point

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01 | 2.8.180111.1 | Last Updated 21 Sep 2012
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100