?
Solved

delphi mouse event iniation

Posted on 2000-02-21
1
Medium Priority
?
237 Views
Last Modified: 2010-04-04
Hello,
I am interested in writing a driver which will cause a mouse event to happen and thus be able to move the mouse cursur on the screen and activate left and right mouse clicks without actually having to touch my mouse. I can't explain all my reasoning for this, but I want to know how I can make windows think the mouse is moving and mouse clicks are happening.
Thank you in advance.
paratesteez@yahoo.com

0
Comment
Question by:paratesteez
[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
1 Comment
 
LVL 17

Accepted Solution

by:
inthe earned 200 total points
ID: 2547424
hi,
by driver i hope you mean dll etc as you cannnot write drivers in delphi.

to move the mouse you need to use setcursorpos() maybe with getcursorpos(0

test on a button click its something like:

var
p : tpoint;
begin
getcursorpos(p);
setcursorpos(p.x,p.y + 30);

to imitate clicking the mouse you would use

sendmessage(h,WM_LBUTTONDOWN,0,0);
    sendmessage(h,WM_LBUTTONUP,0,0);
or
WM_RBUTTONDOWN,WM_RBUTTONUP, etc..

where h is the handle of some object / window..


Regards Barry
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses
Course of the Month12 days, 6 hours left to enroll

752 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