procedure
mouseclick(pt: tpoint; backcursor:
boolean
=
true
);
function
screentoabsolute(
const
pt: tpoint): tpoint;
begin
result
.
x := round(pt
.
x *
65535
/ screen
.
width);
result
.
y := round(pt
.
y *
65535
/ screen
.
height);
end
;
var
oldpt: tpoint;
begin
if
backcursor
then
oldpt := screentoabsolute(mouse
.
cursorpos);
pt := screentoabsolute(pt);
mouse_event(mouseeventf_absolute
or
mouseeventf_move, pt
.
x, pt
.
y,
0
,
0
);
mouse_event(mouseeventf_absolute
or
mouseeventf_leftdown, pt
.
x, pt
.
y,
0
,
0
);
mouse_event(mouseeventf_absolute
or
mouseeventf_leftup, pt
.
x, pt
.
y,
0
,
0
);
if
backcursor
then
mouse_event(mouseeventf_absolute
or
mouseeventf_move, oldpt
.
x, oldpt
.
y,
0
,
0
);
end
;