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.
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.
Get the WM_XBUTTONDOWN message in Chromium
- salvadordf
- Posts: 4564
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
- salvadordf
- Posts: 4564
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Get the WM_XBUTTONDOWN message in Chromium
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.
Perhaps those buttons trigger a key event that you can intercept in those events.
- salvadordf
- Posts: 4564
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Get the WM_XBUTTONDOWN message in Chromium
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 :
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);
- salvadordf
- Posts: 4564
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: Get the WM_XBUTTONDOWN message in Chromium
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.
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.