Solved

delphi mouse event iniation

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

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…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

776 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