Solved

delphi mouse event iniation

Posted on 2000-02-21
1
232 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 50 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

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…

707 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