Move mouse to control (example a button) in Delphi with Firemonkey .
I tried this function:
procedure TFuncoes.MouseParaControle(Controle: TControl);
var // Posiciona o mouse em cima do objeto definido em
IrPara: TPoint; // Ex.: MouseParaControle(button1);
begin
IrPara.X := Controle.Position.X + (Controle.Size.width div 2); // ERRO
IrPara.Y := Controle.Position.y + (Controle.size.Height div 2);// ERRO
if Controle.Parent <> nil then
begin
IrPara := Controle.PointInObjectLocal(irPara.x, irPara.Y);
//Parent.ClientToScreen(IrPara);
SetCursorPos(IrPara.X, IrPara.Y);
end;
end;
ERROR:
[dcc32 Error] Trp.Model.Funcoes.pas (214): E2015 Operator not applicable to this operand type in line