Page 1 of 1

Re: Get the WM_XBUTTONDOWN message in Chromium

Posted: Wed Jun 26, 2019 8:29 am
by salvadordf
Try the TChromium.OnRenderCompMsg event and set aHandled to TRUE for the WM_XBUTTONDOWN message.

The TChromium.OnRenderCompMsg event has a known bug and it stops working after the second TChromium.LoadURL call.

If TChromium.OnRenderCompMsg works the first time and your application needs to load several URLs try using TChromium.RenderCompHWND with SetWindowLongPtr to use a custom procedure to intercept the WM_XBUTTONDOWN message.

Re: Get the WM_XBUTTONDOWN message in Chromium

Posted: Wed Jun 26, 2019 8:33 am
by salvadordf
I don't have one of those mice with navigation buttons but I would try the TChromium.OnPreKeyEvent and TChromium.OnKeyEvent.
Perhaps those buttons trigger a key event that you can intercept in those events.

Re: Get the WM_XBUTTONDOWN message in Chromium

Posted: Mon Jul 08, 2019 7:41 am
by salvadordf
Sorry, I forgot to add that you have to set aMessage.Result too.

I'm not sure if all the Windows message set aMessage.Result as a boolean and I shouldn't set it in the TChromium's code.

In the case of WM_XBUTTONDOWN try setting :

Code: Select all

aHandled := True;
aMessage.Result := LRESULT(True);

Re: Get the WM_XBUTTONDOWN message in Chromium

Posted: Mon Jul 08, 2019 3:47 pm
by salvadordf
Try setting a boolean variable to true when TChromium.OnRenderCompMsg receives a WM_XBUTTONDOWN message and then use the TChromium.OnBeforeBrowse event to cancel the navigation if the previous boolean variable was true.
https://www.briskbard.com/forum/viewtopic.php?f=8&t=700

If that fails, you can also use a low level mouse hook with SetWindowsHookEx and WH_MOUSE_LL to intercept any mouse message.