We help IT Professionals succeed at work.
Get Started

Delphi, control of system mouse from a windows service

DickStorey asked
Last Modified: 2013-11-15
I am coding a windows servce to deliver mouse data from a touch screen to Windows XP.  I have the X and Yparameters from the screen and an indication of when the user has their finger(s) on the screen.  There are two sets of X and Y parameters if the user is doing a rotation or stretch contract.  I now need to deliver this data to windows to control the system mouse in the same way that the normal mouse does.

Question is:  how do I simulate a mouse move, left button down and left button up?  Note that a windows service does not have a window or a Handle so I cannot use the normal Delph mouse control messages. I really do need to simulate the behaviour of the mouse since I want the touch screen to control any application that happens to be under the mouse.

I have tried SendMessage(GetDesktopWindow, WM_MOUSEMOVE, 0, 0); but this does not move the mouse.

It would also be helpful to know how VIsta and & post the second set of X and Y parameters to the system.
Watch Question
This problem has been solved!
Unlock 1 Answer and 4 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE