Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

control mouse cursor move and click

Posted on 2002-04-27
3
Medium Priority
?
347 Views
Last Modified: 2010-04-04
Hi,

does exist the possibility to remote control the mouse cursor and also the click/doubleclick..?

delphiheaven
0
Comment
Question by:delphiheaven
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 3

Accepted Solution

by:
589158 earned 200 total points
ID: 6973226
Hi,

1. Mouseposition
with the SetCursorPos(X,Y) function you can control the position. The SetCursorPos function moves the cursor to the specified screen coordinates. If the new coordinates are not within the screen rectangle set by the most recent ClipCursor function, Windows automatically adjusts the coordinates so that the cursor stays within the rectangle.

Example:
SetCursorPos(0,0);
This sets the cursor to the top left corner of the screen.


2. Mouseclicking

Following function "remote-leftclicks" on the current mouse-position:

mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)

And this for right mbutton:
mouse_event(MOUSEEVENTF_RIGHTDOWN, 0, 0, 0, 0);

And this for middle mbutton:
mouse_event(MOUSEEVENTF_MIDDLEDOWN, 0, 0, 0, 0);


So if you want to doubleclick, you must use the following code:
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)


Hope that helps!

greets,
UTA
0
 
LVL 12

Expert Comment

by:Lee_Nover
ID: 6973687
I suggest using the Mouse variable in D6 (and later newer versions) because of cross-platform compatibility
0
 
LVL 1

Expert Comment

by:pnh73
ID: 9004194
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept answer from 589158

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Paul (pnh73)
EE Cleanup Volunteer
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question