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.

Check "mouse clicked" event inside Chromium browser.

Post Reply
michal@dorfin.waw.pl
Posts: 41
Joined: Sun Feb 05, 2017 8:53 am

Check "mouse clicked" event inside Chromium browser.

Post by michal@dorfin.waw.pl »

Is there any way to check if user clicked on the webpage in Chromium browser ?
I don't need the coordinates. I just need to know if user is active.
Is there any "event" on TChromium that I could handle ?

I know that I can check mouse events in Javascript and send message from renderer process to main process and execute my code in Delphi.
But I'd like to avoid injecting any JS code in the page.
User avatar
salvadordf
Posts: 4057
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Check "mouse clicked" event inside Chromium browser.

Post by salvadordf »

Hi,

Use the TChromium.OnRenderCompMsg event and add this code to intercept the Windows message for mouse clicks :

Code: Select all

  case aMessage.Msg of
    WM_LBUTTONDOWN :
      begin
        // Your code.
      end;
  end;
michal@dorfin.waw.pl
Posts: 41
Joined: Sun Feb 05, 2017 8:53 am

Re: Check "mouse clicked" event inside Chromium browser.

Post by michal@dorfin.waw.pl »

As usual - quick and perfect answer. THANK YOU!
User avatar
salvadordf
Posts: 4057
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Check "mouse clicked" event inside Chromium browser.

Post by salvadordf »

Thanks to you for supporting this open source project in Patreon! :D
Post Reply