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

x
?
Solved

delphi mouse event iniation

Posted on 2000-02-21
1
Medium Priority
?
241 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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…
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 you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

609 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