How to know the sender is devtools or browser in Chromium_OnPreKeyEvent ?
Sender.ClassName always is Tchronium.
Thank you!
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.
How to know the sender is devtools or browser in Chromium_OnPreKeyEvent ?
Re: How to know the sender is devtools or browser in Chromium_OnPreKeyEvent ?
I solve that by the Hokey-Pokey Technique. Is there another better solution?
GetClassName(GetParent(GetParent(GetParent(atemphandle))), @arrclass, SizeOf(arrclass)); atempStr := PChar(@arrclass); if (ansipos('Form', atempStr )>0) then PostMessage(Handle, MINIBROWSER_SHOWSEARCHFORM, TempParam, 0);
Chromium_OnPreKeyEvent, arrclass: array[0..254] of Char;
atemphandle: aMsg.hwnd or osEvent.hwnd
GetClassName(GetParent(GetParent(GetParent(atemphandle))), @arrclass, SizeOf(arrclass)); atempStr := PChar(@arrclass); if (ansipos('Form', atempStr )>0) then PostMessage(Handle, MINIBROWSER_SHOWSEARCHFORM, TempParam, 0);
Chromium_OnPreKeyEvent, arrclass: array[0..254] of Char;
atemphandle: aMsg.hwnd or osEvent.hwnd
- salvadordf
- Posts: 4564
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: How to know the sender is devtools or browser in Chromium_OnPreKeyEvent ?
Compare the browser.identifier value in that event with TChromiumCore.BrowserId.
They should be different for the DevTools.
They should be different for the DevTools.
Re: How to know the sender is devtools or browser in Chromium_OnPreKeyEvent ?
I'll try it, thank you very much!salvadordf wrote: Mon Nov 25, 2024 8:12 am Compare the browser.identifier value in that event with TChromiumCore.BrowserId.
They should be different for the DevTools.
Re: How to know the sender is devtools or browser in Chromium_OnPreKeyEvent ?
TMiniBrowserFrm.Chromium_OnPreKeyEvent (Sender: TObject;
const browser: ICefBrowser; const event: PCefKeyEvent;
osEvent: TCefEventHandle; out isKeyboardShortcut, Result: Boolean);
No TChromiumCore.BrowserId can be found.
const browser: ICefBrowser; const event: PCefKeyEvent;
osEvent: TCefEventHandle; out isKeyboardShortcut, Result: Boolean);
No TChromiumCore.BrowserId can be found.
- salvadordf
- Posts: 4564
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: How to know the sender is devtools or browser in Chromium_OnPreKeyEvent ?
Use the name of the component in your application. For example: Chromium1.BrowserId
Re: How to know the sender is devtools or browser in Chromium_OnPreKeyEvent ?
But I create it for a new window.salvadordf wrote: Wed Nov 27, 2024 2:04 pm Use the name of the component in your application. For example: Chromium1.BrowserId
