How to Simulate a mouse move in code?
Answer / Alok Deep Satwalia
In Delphi, you can use the TWinControl.PostMessage method with the WM_MOUSEMOVE message to simulate a mouse move programmatically. Here's a simple example:nn```delphin// Get the current position of the form (or any other control)
var
ptForm: TPoint;
begin
// Set the new position for the mouse cursor
ptForm.X := 100;
ptForm.Y := 200;
// Send the WM_MOUSEMOVE message to move the mouse cursor to the new position
SendMessage(Handle, WM_MOUSEMOVE, 0, MakeLongInt(ptForm.X, ptForm.Y));
end;n``
| Is This Answer Correct ? | 0 Yes | 0 No |
How to Get user name and company info from Windows?
What are the different ways of defining array sizes?
How to Display a bitmap on the client area of an MDI parent form?
How to detect the computer name?
why Paradox slow on some computers and not on others ?
What is Delphi/400 Client Server Suite?
How to Disable system menu in code?
What directory is the ActiveForm in ?
Are there any tools to help me migrate my applications to Delphi?
How to Change the main form of an application at runtime ?
How to create an example of your problem for Borland Developer Support?
Explain the findfirst method?