Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
If you find these projects useful please consider becoming a sponsor with Patreon, GitHub or Liberapay.

Click

Post Reply
Kazann117
Posts: 41
Joined: Mon Jan 07, 2019 10:08 pm

Click

Post by Kazann117 »

Good day, such a question does not always work click inside the browser how can I fix it?


if more precisely on certain parts of the screen, for example, click on edit on the site but it does not click, but for example clicks on

procedure TForm1.Simulate_Mouse_Click(X, Y: string);
var
MouseEvent : TCefMouseEvent;
KeyEvent : TCefKeyEvent;
begin
MouseEvent.x := strtoint(X);
MouseEvent.y := strtoint(Y);
Chromium1.Browser.Host.SendFocusEvent(true);
Chromium1.Browser.Host.SendMouseClickEvent(PCefMouseEvent(@MouseEvent), MBT_LEFT, false, 1);
Chromium1.Browser.Host.SendMouseClickEvent(PCefMouseEvent(@MouseEvent), MBT_LEFT, true, 1);
end;
User avatar
salvadordf
Posts: 4571
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Click

Post by salvadordf »

Perhaps those functions can't be called so fast. Try adding a delay between the 2 SendMouseClickEvent calls to simulate a real click.
ForestListener
Posts: 44
Joined: Sun Jul 07, 2019 1:46 pm

Re: Click

Post by ForestListener »

This method does not work with clicking "I'm Feeling Lucky" button at Google.com

Does anybody has a suggestion to do it with SendMouseClickEvent?
Post Reply