Solved

Move the mouse cursor

Posted on 1998-01-20
2
160 Views
Last Modified: 2010-04-04
What are the possibilities that I have to move the mouse cursor to a specified position in Delphi 2.0?
0
Comment
Question by:e4muell1
  • 2
2 Comments
 
LVL 8

Expert Comment

by:ZifNab
ID: 1357041
What about sending a WM_MOUSEMOVE message?
0
 
LVL 8

Accepted Solution

by:
ZifNab earned 40 total points
ID: 1357042
Sorry, it's even easier :

procedure PlaceMouse(x, y: word);
var
  tp: TPoint;
begin
  tp := ClientToScreen(point(x, y));
  SetCursorPos(tp.x, tp.y);
end;
procedure PlaceMouse(x, y: word);
var
  tp: TPoint;
begin
  tp := ClientToScreen(point(x, y));
  SetCursorPos(tp.x, tp.y);
end;

{ This code came from Lloyd's help file! }

0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…

856 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