Solved

delphi mouse event iniation

Posted on 2000-02-21
1
220 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
Comment Utility
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This video discusses moving either the default database or any database to a new volume.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

771 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now