Michael wrote

What do you mean with mouse_event ?

May be if I give the Delphi code, you understand better than with a lot of
sentences.

procedure LikeMouseClick(PositionClick_X : integer; PositionClick_Y : integer;
BackToPositionOrigine : Boolean = True);
var
  SavePointOrigine: TPoint;
begin
   GetCursorPos(SavePointOrigine);
   try
      SetCursorPos(PositionClick_X, PositionClick_Y);
      mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
      mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
   finally
      if BackToPositionOrigine then
         SetCursorPos(SavePointOrigine.X, SavePointOrigine.Y);
   end;
end;

If I code

LikeMouseClik(10,10,true);

in my program, the mouse pointer goes back to [10,10], so I don't have to
physically click in a window to set focus.




--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to